mirror of
https://github.com/withastro/astro.git
synced 2025-02-17 22:44:24 -05:00
chore(alpinejs): add e2e test (#9812)
* fix(rss): rssSchema definition to allow calling standard zod object methods * fix: condition * chore(alpinejs): add e2e test * Discard changes to .changeset/mighty-icons-try.md --------- Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
This commit is contained in:
parent
54acb6aeb4
commit
c820defe65
5 changed files with 64 additions and 0 deletions
6
packages/integrations/alpinejs/test/fixtures/plugin-script-import/astro.config.mjs
vendored
Normal file
6
packages/integrations/alpinejs/test/fixtures/plugin-script-import/astro.config.mjs
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
import { defineConfig } from 'astro/config';
|
||||
import alpine from '@astrojs/alpinejs';
|
||||
|
||||
export default defineConfig({
|
||||
integrations: [alpine()],
|
||||
})
|
11
packages/integrations/alpinejs/test/fixtures/plugin-script-import/package.json
vendored
Normal file
11
packages/integrations/alpinejs/test/fixtures/plugin-script-import/package.json
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"name": "@test/alpinejs-plugin-script-import",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@astrojs/alpinejs": "workspace:*",
|
||||
"@types/alpinejs": "^3.13.5",
|
||||
"alpinejs": "^3.13.3",
|
||||
"astro": "workspace:*"
|
||||
}
|
||||
}
|
19
packages/integrations/alpinejs/test/fixtures/plugin-script-import/src/pages/index.astro
vendored
Normal file
19
packages/integrations/alpinejs/test/fixtures/plugin-script-import/src/pages/index.astro
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Testing</title>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/@alpinejs/collapse@3.x.x/dist/cdn.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div x-data="{ expanded: false }">
|
||||
<button @click="expanded = ! expanded">Toggle Content</button>
|
||||
|
||||
<p id="foo" x-show="expanded" x-collapse>
|
||||
Lorem ipsum dolor sit amet consectetur adipisicing elit.
|
||||
Doloribus eum placeat modi deserunt reiciendis aspernatur
|
||||
praesentium natus, reprehenderit fugiat cupiditate, eaque
|
||||
voluptatibus mollitia alias dicta at, perferendis cum.
|
||||
Cumque, dignissimos?
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,13 @@
|
|||
import { expect } from '@playwright/test';
|
||||
import { prepareTestFactory } from './test-utils.js';
|
||||
|
||||
const { test } = prepareTestFactory({ root: './fixtures/plugin-script-import/' });
|
||||
|
||||
test.describe('Plugin Script Import', () => {
|
||||
test('Extending Alpine using a script import should work', async ({ page, astro }) => {
|
||||
await page.goto(astro.resolveUrl('/'));
|
||||
|
||||
const el = page.locator('#foo');
|
||||
expect(await el.getAttribute("hidden")).toBe('');
|
||||
});
|
||||
});
|
15
pnpm-lock.yaml
generated
15
pnpm-lock.yaml
generated
|
@ -3833,6 +3833,21 @@ importers:
|
|||
specifier: workspace:*
|
||||
version: link:../../../../../astro
|
||||
|
||||
packages/integrations/alpinejs/test/fixtures/plugin-script-import:
|
||||
dependencies:
|
||||
'@astrojs/alpinejs':
|
||||
specifier: workspace:*
|
||||
version: link:../../..
|
||||
'@types/alpinejs':
|
||||
specifier: ^3.13.5
|
||||
version: 3.13.5
|
||||
alpinejs:
|
||||
specifier: ^3.13.3
|
||||
version: 3.13.3
|
||||
astro:
|
||||
specifier: workspace:*
|
||||
version: link:../../../../../astro
|
||||
|
||||
packages/integrations/cloudflare: {}
|
||||
|
||||
packages/integrations/lit:
|
||||
|
|
Loading…
Add table
Reference in a new issue