Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add modern-js module doc fixed iframe test #1070

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions e2e/fixtures/modern-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,5 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5"
},
"sideEffects": []
}
}
14 changes: 13 additions & 1 deletion e2e/tests/modern-js.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getPort, killProcess, runDevCommand } from '../utils/runCommands';

const fixtureDir = path.resolve(__dirname, '../fixtures');

test.describe('plugin test', async () => {
test.describe('modernjs module doc test', async () => {
let appPort;
let app;
test.beforeAll(async () => {
Expand All @@ -28,4 +28,16 @@ test.describe('plugin test', async () => {
});
expect(h1).toBeTruthy();
});

test('preview iframe fixed should display', async ({ page }) => {
await page.goto(`http://localhost:${appPort}/general/button`, {
waitUntil: 'networkidle',
});

const iframe = await page.$('.fixed-device');
const leftCssValue = await iframe?.evaluate(el => {
return window.getComputedStyle(el).getPropertyValue('left');
});
expect(leftCssValue).not.toEqual('0px');
});
});
Loading