Skip to content

Commit

Permalink
test: add modern-js module doc fixed iframe test
Browse files Browse the repository at this point in the history
  • Loading branch information
Timeless0911 committed May 9, 2024
1 parent 863e25f commit 9f01756
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
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');
});
});

0 comments on commit 9f01756

Please sign in to comment.