diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 7ac35d2..efbfe5a 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -20,25 +20,27 @@ extra large 2 {/snippet} - - {#snippet sm()} - small - {/snippet} - {#snippet md()} - medium - {/snippet} - {#snippet lg()} - large - {/snippet} - {#snippet xl()} - extra large - {/snippet} - unknown - + + + {#snippet sm()} + small + {/snippet} + {#snippet md()} + medium + {/snippet} + {#snippet lg()} + large + {/snippet} + {#snippet xl()} + extra large + {/snippet} + unknown + + -

Here are all matching queries from binding to the store: {$matches.join(', ')}

+

Here are all matching queries from binding to the store: {$matches.join(', ')}

{ ).toBeVisible(); } }); + +test('store of current matches functions as expected', async ({ page }) => { + await page.goto('/'); + + await page.setViewportSize({ width: 400, height: 600 }); + + await expect(page.locator('[data-test-id="matches-store"]')).toBeVisible(); + + expect( + await page.locator('[data-test-id="matches-store"]').textContent() + ).toEqual('sm'); + + await page.setViewportSize({ width: 800, height: 600 }); + + expect( + await page.locator('[data-test-id="matches-store"]').textContent() + ).toEqual('sm, md'); + + await page.setViewportSize({ width: 1050, height: 600 }); + + expect( + await page.locator('[data-test-id="matches-store"]').textContent() + ).toEqual('sm, md, lg'); +});