@@ -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} ) ;
0 commit comments