Skip to content

Commit 12a19b6

Browse files
author
Sasha Milenkovic
committed
test: adds framework test for solidjs
1 parent 4f33e6f commit 12a19b6

File tree

4 files changed

+125
-10
lines changed

4 files changed

+125
-10
lines changed

playwright.config.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,24 @@ export default defineConfig({
1515
projects: [
1616
{
1717
name: "Desktop Chrome",
18-
testMatch: "tests/drag/**/*.spec.ts",
18+
testMatch: ["tests/drag/**/*.spec.ts", "tests-frameworks/**/*.spec.ts"],
19+
1920
use: {
2021
...devices["Desktop Chrome"],
2122
},
2223
},
2324
{
2425
name: "Desktop Firefox",
25-
testMatch: "tests/drag/**/*.spec.ts",
26+
testMatch: ["tests/drag/**/*.spec.ts", "tests-frameworks/**/*.spec.ts"],
27+
2628
use: {
2729
...devices["Desktop Firefox"],
2830
},
2931
},
3032
{
3133
name: "Desktop Webkit",
32-
testMatch: "tests/drag/**/*.spec.ts",
34+
testMatch: ["tests/drag/**/*.spec.ts", "tests-frameworks/**/*.spec.ts"],
35+
3336
use: {
3437
...devices["Desktop Webkit"],
3538
},

playwright/tests-frameworks/index.spec.ts

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,4 +242,122 @@ test.describe("React wrapper working as expected", async () => {
242242
"jack_of_hearts queen_of_spades 10_of_clubs"
243243
);
244244
});
245+
246+
test.describe("Solid wrappers working as expected", async () => {
247+
test("dragAndDrop() can enable sorting, accept new values, and update the parent config", async () => {
248+
// Check that the list items can be sorted
249+
await drag(page, {
250+
originEl: {
251+
id: "solid_drag_and_drop_10_of_clubs",
252+
position: "center",
253+
},
254+
destinationEl: {
255+
id: "solid_drag_and_drop_jack_of_hearts",
256+
position: "center",
257+
},
258+
dragStart: true,
259+
drop: true,
260+
});
261+
await expect(page.locator("#solid_drag_and_drop_values")).toHaveText(
262+
"jack_of_hearts 10_of_clubs"
263+
);
264+
// Add value
265+
await page.locator("#solid_drag_and_drop_add_value").click();
266+
await expect(page.locator("#solid_drag_and_drop_values")).toHaveText(
267+
"jack_of_hearts 10_of_clubs queen_of_spades"
268+
);
269+
// Check that the list items can be sorted
270+
await drag(page, {
271+
originEl: {
272+
id: "solid_drag_and_drop_10_of_clubs",
273+
position: "center",
274+
},
275+
destinationEl: {
276+
id: "solid_drag_and_drop_queen_of_spades",
277+
position: "center",
278+
},
279+
dragStart: true,
280+
drop: true,
281+
});
282+
await expect(page.locator("#solid_drag_and_drop_values")).toHaveText(
283+
"jack_of_hearts queen_of_spades 10_of_clubs"
284+
);
285+
// Disable drag and drop
286+
await page.locator("#solid_drag_and_drop_disable").click();
287+
// Check that the list items can not be sorted
288+
await drag(page, {
289+
originEl: {
290+
id: "solid_drag_and_drop_10_of_clubs",
291+
position: "center",
292+
},
293+
destinationEl: {
294+
id: "solid_drag_and_drop_queen_of_spades",
295+
position: "center",
296+
},
297+
dragStart: true,
298+
drop: true,
299+
});
300+
await expect(page.locator("#solid_drag_and_drop_values")).toHaveText(
301+
"jack_of_hearts queen_of_spades 10_of_clubs"
302+
);
303+
});
304+
305+
test("useDragAndDrop() can enable sorting, accept new values, and update the parent config", async () => {
306+
// Check that the list items can be sorted
307+
await drag(page, {
308+
originEl: {
309+
id: "solid_use_drag_and_drop_10_of_clubs",
310+
position: "center",
311+
},
312+
destinationEl: {
313+
id: "solid_use_drag_and_drop_jack_of_hearts",
314+
position: "center",
315+
},
316+
dragStart: true,
317+
drop: true,
318+
});
319+
await expect(page.locator("#solid_use_drag_and_drop_values")).toHaveText(
320+
"jack_of_hearts 10_of_clubs"
321+
);
322+
// Add value
323+
await page.locator("#solid_use_drag_and_drop_add_value").click();
324+
await expect(page.locator("#solid_use_drag_and_drop_values")).toHaveText(
325+
"jack_of_hearts 10_of_clubs queen_of_spades"
326+
);
327+
// Check that the list items can be sorted
328+
await drag(page, {
329+
originEl: {
330+
id: "solid_use_drag_and_drop_10_of_clubs",
331+
position: "center",
332+
},
333+
destinationEl: {
334+
id: "solid_use_drag_and_drop_queen_of_spades",
335+
position: "center",
336+
},
337+
dragStart: true,
338+
drop: true,
339+
});
340+
await expect(page.locator("#solid_use_drag_and_drop_values")).toHaveText(
341+
"jack_of_hearts queen_of_spades 10_of_clubs"
342+
);
343+
// Disable drag and drop
344+
await page.locator("#solid_use_drag_and_drop_disable").click();
345+
// Check that the list items can not be sorted
346+
await drag(page, {
347+
originEl: {
348+
id: "solid_use_drag_and_drop_10_of_clubs",
349+
position: "center",
350+
},
351+
destinationEl: {
352+
id: "solid_use_drag_and_drop_jack_of_hearts",
353+
position: "center",
354+
},
355+
dragStart: true,
356+
drop: true,
357+
});
358+
await expect(page.locator("#solid_use_drag_and_drop_values")).toHaveText(
359+
"jack_of_hearts queen_of_spades 10_of_clubs"
360+
);
361+
});
362+
});
245363
});

tests/.nuxt/nuxt.d.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
// Generated by nuxi
2-
<<<<<<< HEAD
32
/// <reference types="@nuxtjs/tailwindcss" />
43
/// <reference types="@nuxt/telemetry" />
54
/// <reference types="@nuxt/devtools" />
6-
=======
7-
/// <reference types="@nuxt/devtools" />
8-
/// <reference types="@nuxt/telemetry" />
9-
/// <reference types="@nuxtjs/tailwindcss" />
10-
>>>>>>> main
115
/// <reference types="nuxt" />
126
/// <reference path="types/app-defaults.d.ts" />
137
/// <reference path="types/plugins.d.ts" />

tests/.nuxt/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"./imports"
9191
],
9292
"#app-manifest": [
93-
"./manifest/meta/dev.json"
93+
"./manifest/meta/dev"
9494
],
9595
"#build": [
9696
"."

0 commit comments

Comments
 (0)