Skip to content

Commit

Permalink
test: attempts to reload after each page navigation in sorts tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sashamilenkovic committed Apr 1, 2024
1 parent 89cc0d0 commit 406fcb1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
6 changes: 5 additions & 1 deletion playwright/tests/drag/sort.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import { dragDrop } from "../../utils";

let page: Page;

test.beforeAll(async ({ browser }) => {
test.beforeEach(async ({ browser }) => {
page = await browser.newPage();
});

test.describe("Sorting", async () => {
test("Drag sort", async () => {
await page.goto("http://localhost:3001/sort");
await page.reload();
await dragDrop(page, {
originEl: { id: "Apple", position: "center" },
destinationEl: { id: "Banana", position: "center" },
Expand Down Expand Up @@ -45,6 +46,7 @@ test.describe("Sorting", async () => {

test("Uneven drag sort", async () => {
await page.goto("http://localhost:3001/sort/uneven");
await page.reload();
await dragDrop(page, {
originEl: { id: "Apple", position: "center" },
destinationEl: { id: "Banana", position: "center" },
Expand Down Expand Up @@ -80,6 +82,7 @@ test.describe("Sorting", async () => {

test("Sort with animations", async () => {
await page.goto("http://localhost:3001/sort/animations");
await page.reload();
await dragDrop(page, {
originEl: { id: "Apple", position: "center" },
destinationEl: { id: "Banana", position: "center" },
Expand Down Expand Up @@ -115,6 +118,7 @@ test.describe("Sorting", async () => {

test("Sort with uneven els and animations", async () => {
await page.goto("http://localhost:3001/sort/uneven-animations");
await page.reload();
await dragDrop(page, {
originEl: { id: "Apple", position: "center" },
destinationEl: { id: "Banana", position: "center" },
Expand Down
12 changes: 1 addition & 11 deletions tests/pages/swap/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const [parent3, values3] = useDragAndDrop(
</script>

<template>
<h1>Transfer</h1>
<h1>Swap</h1>
<div class="flex-wrap">
<div>
<ul id="transfer_1" ref="parent1" class="list">
Expand All @@ -49,16 +49,6 @@ const [parent3, values3] = useDragAndDrop(
</span>
</ul>
</div>
<div>
<ul id="3" ref="parent3" class="list">
<li v-for="value in values3" :id="value" :key="value" class="item">
{{ value }}
</li>
<span id="values_3" class="text-xs">
{{ values3.map((x) => x).join(" ") }}
</span>
</ul>
</div>
</div>
</template>

Expand Down

0 comments on commit 406fcb1

Please sign in to comment.