add an integration tests for react and styled components

This commit is contained in:
Yanzhen Yu
2020-03-21 23:21:45 +08:00
parent 5e549c4ee4
commit 02a33faaf9
3 changed files with 472 additions and 2 deletions

View File

@@ -129,7 +129,7 @@ describe('record integration tests', function(this: ISuite) {
const snapshots = await page.evaluate('window.snapshots');
assertSnapshot(snapshots, __filename, 'select2');
}).timeout(10000);
});
it('should not record input events on ignored elements', async () => {
const page: puppeteer.Page = await this.browser.newPage();
@@ -205,4 +205,13 @@ describe('record integration tests', function(this: ISuite) {
const snapshots = await page.evaluate('window.snapshots');
assertSnapshot(snapshots, __filename, 'move-node-2');
});
});
it('should record dynamic CSS changes', async () => {
const page: puppeteer.Page = await this.browser.newPage();
await page.goto('about:blank');
await page.setContent(getHtml.call(this, 'react-styled-components.html'));
await page.click('.toggle');
const snapshots = await page.evaluate('window.snapshots');
assertSnapshot(snapshots, __filename, 'react-styled-components');
});
}).timeout(10000);