add select2.html snapshot test
This commit is contained in:
File diff suppressed because one or more lines are too long
26
test/html/select2.html
Normal file
26
test/html/select2.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>Select2 3.5</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2@3.5.1/select2.css">
|
||||
</head>
|
||||
<body>
|
||||
<blockquote>
|
||||
Select2 is a jQuery replacement for select boxes.
|
||||
<br>
|
||||
In the 3.5 version it use a quite complicated DOM generation strategy which is a good battle-test for rrweb's recorder.
|
||||
</blockquote>
|
||||
<select id="el">
|
||||
<option value="a">A</option>
|
||||
<option value="b">B</option>
|
||||
</select>
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/select2@3.5.2-browserify/select2.min.js"></script>
|
||||
<script>
|
||||
$('#el').select2();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -174,4 +174,23 @@ describe('record integration tests', () => {
|
||||
);
|
||||
assert(result.pass, result.pass ? '' : result.report());
|
||||
});
|
||||
|
||||
it('can record node mutations', async () => {
|
||||
const page: puppeteer.Page = await this.browser.newPage();
|
||||
await page.goto(`data:text/html,${getHtml.call(this, 'select2.html')}`, {
|
||||
waitUntil: 'networkidle0',
|
||||
});
|
||||
|
||||
// toggle the select box
|
||||
await page.click('.select2-container');
|
||||
await page.click('.select2-container');
|
||||
|
||||
const snapshots = await page.evaluate('window.snapshots');
|
||||
const result = matchSnapshot(
|
||||
stringifySnapshots(snapshots),
|
||||
__filename,
|
||||
'select2',
|
||||
);
|
||||
assert(result.pass, result.pass ? '' : result.report());
|
||||
}).timeout(5000);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user