Tier List Maker toggles work, items can be dragged, and state persists after reload Renders/tier-list-maker
Tier list maker page Tier list maker page Act
Open the tier list maker page
await tierList.goto ();Set placement mode “drag”
await tierList.setPlacementMode ("drag" );Assert
empty tiers drag mode count is 5
await expect (tierList.locators.emptyTiersDragMode).toHaveCount (5 );Act
Toggle “noDuplicates”
await tierList.toggle ("noDuplicates" );Toggle “showTierHeaders”
await tierList.toggle ("showTierHeaders" );Toggle “hideAltKits”
await tierList.toggle ("hideAltKits" );Toggle “hideAltSkins”
await tierList.toggle ("hideAltSkins" );Drag first item to last empty tier “main-weapon”
await tierList.dragFirstItemToLastEmptyTier ("main-weapon" );Drag first item to last empty tier “main-weapon”
await tierList.dragFirstItemToLastEmptyTier ("main-weapon" );Open tab “stage”
await tierList.openTab ("stage" );Assert
first pool items “stage” is visible
await expect (tierList.poolItems ("stage" ).first ()).toBeVisible ();Act
Drag first item to last empty tier “stage”
await tierList.dragFirstItemToLastEmptyTier ("stage" );Reload
await tierList.reload ();placement mode is not persisted, unlike the tiers themselves
Set placement mode “drag”
await tierList.setPlacementMode ("drag" );Assert
each of the three dragged items landed in a tier of its own
empty tiers drag mode count is 2
await expect (tierList.locators.emptyTiersDragMode).toHaveCount (2 );Source test ("toggles work, items can be dragged, and state persists after reload" , async ({
page,
}) => {
const tierList = new TierListMakerPage (page);
await tierList.goto ();
await tierList.setPlacementMode ("drag" );
await expect (tierList.locators.emptyTiersDragMode).toHaveCount (5 );
await tierList.toggle ("noDuplicates" );
await tierList.toggle ("showTierHeaders" );
await tierList.toggle ("hideAltKits" );
await tierList.toggle ("hideAltSkins" );
await tierList.dragFirstItemToLastEmptyTier ("main-weapon" );
await tierList.dragFirstItemToLastEmptyTier ("main-weapon" );
await tierList.openTab ("stage" );
await expect (tierList.poolItems ("stage" ).first ()).toBeVisible ();
await tierList.dragFirstItemToLastEmptyTier ("stage" );
await tierList.reload ();
// placement mode is not persisted, unlike the tiers themselves
await tierList.setPlacementMode ("drag" );
// each of the three dragged items landed in a tier of its own
await expect (tierList.locators.emptyTiersDragMode).toHaveCount (2 );
})click to place mode adds items to the selected tier Renders/tier-list-maker
Tier list maker page Tier list maker page Act
Open the tier list maker page
await tierList.goto ();Set placement mode “click”
await tierList.setPlacementMode ("click" );Assert
empty tiers click mode count is 5
await expect (tierList.locators.emptyTiersClickMode).toHaveCount (5 );Act
the first tier is selected by default
Click first item “main-weapon”
await tierList.clickFirstItem ("main-weapon" );Assert
empty tiers click mode count is 4
await expect (tierList.locators.emptyTiersClickMode).toHaveCount (4 );Act
Select first empty tier
await tierList.selectFirstEmptyTier ();Click first item “main-weapon”
await tierList.clickFirstItem ("main-weapon" );Assert
empty tiers click mode count is 3
await expect (tierList.locators.emptyTiersClickMode).toHaveCount (3 );Source test ("click to place mode adds items to the selected tier" , async ({
page,
}) => {
const tierList = new TierListMakerPage (page);
await tierList.goto ();
await tierList.setPlacementMode ("click" );
await expect (tierList.locators.emptyTiersClickMode).toHaveCount (5 );
// the first tier is selected by default
await tierList.clickFirstItem ("main-weapon" );
await expect (tierList.locators.emptyTiersClickMode).toHaveCount (4 );
await tierList.selectFirstEmptyTier ();
await tierList.clickFirstItem ("main-weapon" );
await expect (tierList.locators.emptyTiersClickMode).toHaveCount (3 );
})tiers are reordered by dragging their handle Renders/tier-list-maker
Tier list maker page Tier list maker page Act
Open the tier list maker page
await tierList.goto ();Assert
tier ids equals “tier-x” , “tier-s” , “tier-a” , “tier-b” , “tier-c”
expect (await tierList.tierIds ()).toEqual ([
"tier-x" ,
"tier-s" ,
"tier-a" ,
"tier-b" ,
"tier-c" ,
]);Act
Drag tier from 0 to 2
await tierList.dragTier ({ from : 0 , to: 2 });Assert
tier ids equals “tier-s” , “tier-a” , “tier-x” , “tier-b” , “tier-c”
expect (await tierList.tierIds ()).toEqual ([
"tier-s" ,
"tier-a" ,
"tier-x" ,
"tier-b" ,
"tier-c" ,
]);Act
Reload
await tierList.reload ();Assert
tier ids equals “tier-s” , “tier-a” , “tier-x” , “tier-b” , “tier-c”
expect (await tierList.tierIds ()).toEqual ([
"tier-s" ,
"tier-a" ,
"tier-x" ,
"tier-b" ,
"tier-c" ,
]);Source test ("tiers are reordered by dragging their handle" , async ({ page }) => {
const tierList = new TierListMakerPage (page);
await tierList.goto ();
expect (await tierList.tierIds ()).toEqual ([
"tier-x" ,
"tier-s" ,
"tier-a" ,
"tier-b" ,
"tier-c" ,
]);
await tierList.dragTier ({ from : 0 , to: 2 });
expect (await tierList.tierIds ()).toEqual ([
"tier-s" ,
"tier-a" ,
"tier-x" ,
"tier-b" ,
"tier-c" ,
]);
await tierList.reload ();
expect (await tierList.tierIds ()).toEqual ([
"tier-s" ,
"tier-a" ,
"tier-x" ,
"tier-b" ,
"tier-c" ,
]);
})TierListMakerPage.gotoe2e/pages/tier-list-maker/tier-list-maker-page.ts:55
No JSDoc
async goto () {
await navigate ({ page: this .page, url: TIER_LIST_MAKER_URL });
}TierListMakerPage.setPlacementModee2e/pages/tier-list-maker/tier-list-maker-page.ts:77
No JSDoc
async setPlacementMode (mode: "drag" | "click" ) {
await this .page
.getByText (mode === "drag" ? "Drag & drop" : "Click to place" )
.click ();
}TierListMakerPage.locators.emptyTiersDragModee2e/pages/tier-list-maker/tier-list-maker-page.ts:49
No JSDoc
page.getByText ("Drop items here" ) TierListMakerPage.togglee2e/pages/tier-list-maker/tier-list-maker-page.ts:83
No JSDoc
async toggle (name: Toggle ) {
await this .page.getByText (TOGGLE_NAMES [name]).click ();
}TierListMakerPage.dragFirstItemToLastEmptyTiere2e/pages/tier-list-maker/tier-list-maker-page.ts:87
No JSDoc
async dragFirstItemToLastEmptyTier (type : ItemType ) {
const emptyTiers = this .locators.emptyTiersDragMode;
const emptyCountBefore = await emptyTiers.count ();
await dragAndDrop (this .page, {
from : this .poolItems (type ).first (),
to: emptyTiers.last (),
});
await expect (emptyTiers).toHaveCount (emptyCountBefore - 1 );
}TierListMakerPage.openTabe2e/pages/tier-list-maker/tier-list-maker-page.ts:71
No JSDoc
async openTab (type : ItemType ) {
const tab = this .page.getByRole ("tab" , { name: TAB_NAMES [type ] });
await tab.click ();
await expect (tab).toHaveAttribute ("aria-selected" , "true" );
}TierListMakerPage.poolItemse2e/pages/tier-list-maker/tier-list-maker-page.ts:65
No JSDoc
poolItems (type : ItemType ) {
return this .page
.getByRole ("tabpanel" )
.locator (`[data-item-id^="${type}:"]` );
}TierListMakerPage.reloade2e/pages/tier-list-maker/tier-list-maker-page.ts:60
async reload () {
await this .page.reload ();
await expectIsHydrated (this .page);
}TierListMakerPagee2e/pages/tier-list-maker/tier-list-maker-page.ts:42
No JSDoc
TierListMakerPage.locators.emptyTiersClickModee2e/pages/tier-list-maker/tier-list-maker-page.ts:50
No JSDoc
page.getByText ("Click items to add here" ) TierListMakerPage.clickFirstIteme2e/pages/tier-list-maker/tier-list-maker-page.ts:117
No JSDoc
async clickFirstItem (type : ItemType ) {
await this .poolItems (type ).first ().click ();
}TierListMakerPage.selectFirstEmptyTiere2e/pages/tier-list-maker/tier-list-maker-page.ts:121
No JSDoc
async selectFirstEmptyTier () {
await this .locators.emptyTiersClickMode.first ().click ();
}TierListMakerPage.tierIdse2e/pages/tier-list-maker/tier-list-maker-page.ts:100
async tierIds () {
return this .page
.locator ("[data-tier-id]" )
.evaluateAll ((rows) =>
rows.map ((row) => (row as HTMLElement ).dataset.tierId),
);
}TierListMakerPage.dragTiere2e/pages/tier-list-maker/tier-list-maker-page.ts:108
No JSDoc
async dragTier ({ from , to }: { from : number ; to: number }) {
const handles = this .locators.tierDragHandles;
await dragAndDrop (this .page, {
from : handles.nth (from ),
to: handles.nth (to),
});
}