-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #210 from chromaui/andrew/ap-5218-tweak-version-of…
…-rrweb-used-by-chromatic-by-default Properly load rrweb-snapshot on AMD-based web pages
- Loading branch information
Showing
6 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@chromatic-com/playwright': patch | ||
--- | ||
|
||
Add support for AMD module-based web pages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { test, expect } from '../src'; | ||
|
||
test('pages with AMD modules are archived', async ({ page }) => { | ||
await page.goto('/amd'); | ||
await expect(page.getByText('Sum of')).toBeVisible(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>AMD Example</title> | ||
<script | ||
data-main="scripts/amd" | ||
src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" | ||
></script> | ||
</head> | ||
<body> | ||
This is a basic page with some math content below that is loaded from an AMD module: | ||
<div id="output"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
requirejs.config({ | ||
basePath: 'fixtures/amd', | ||
paths: { | ||
lodash: 'https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min', | ||
}, | ||
}); | ||
|
||
require(['lodash'], function (_) { | ||
const numbers = [1, 2, 3, 4, 5]; | ||
const sum = _.sum(numbers); | ||
document.getElementById('output').textContent = `Sum of ${numbers.join('+')} = ${sum}`; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters