2020-08-06 02:44:17 +08:00
|
|
|
const VirtualizedList = require('./virtualizedlist/virtualize');
|
2021-02-17 04:57:10 +08:00
|
|
|
const { TEST_DURATION_TIME } = require('./core/constants');
|
2020-10-09 03:25:35 +08:00
|
|
|
const { toMatchImageSnapshot } = require('jest-image-snapshot');
|
|
|
|
|
|
|
|
expect.extend({ toMatchImageSnapshot });
|
2020-08-06 02:44:17 +08:00
|
|
|
|
|
|
|
const virtualizedListTest = () => {
|
2020-08-14 10:41:14 +08:00
|
|
|
test('Virtualized Users List', async () => {
|
2020-08-06 02:44:17 +08:00
|
|
|
const test = new VirtualizedList();
|
|
|
|
let response;
|
2020-10-09 03:25:35 +08:00
|
|
|
let screenshot;
|
2020-08-06 02:44:17 +08:00
|
|
|
try {
|
2021-02-17 04:57:10 +08:00
|
|
|
const testName = 'virtualizedUserList';
|
|
|
|
await test.page1.logger('begin of ', testName);
|
2021-02-26 23:52:17 +08:00
|
|
|
await test.init(undefined, testName);
|
|
|
|
await test.page1.startRecording(testName);
|
2020-08-06 02:44:17 +08:00
|
|
|
response = await test.test();
|
2021-02-26 23:52:17 +08:00
|
|
|
await test.page1.stopRecording();
|
2020-10-09 03:25:35 +08:00
|
|
|
screenshot = await test.page1.page.screenshot();
|
2021-02-17 04:57:10 +08:00
|
|
|
await test.page1.logger('end of ', testName);
|
2021-08-26 22:13:18 +08:00
|
|
|
} catch (err) {
|
|
|
|
await test.page1.logger(err);
|
2020-08-06 02:44:17 +08:00
|
|
|
} finally {
|
|
|
|
await test.close();
|
|
|
|
}
|
|
|
|
expect(response).toBe(true);
|
2021-06-06 23:30:46 +08:00
|
|
|
await Page.checkRegression(0.05, screenshot);
|
2021-02-17 04:57:10 +08:00
|
|
|
}, parseInt(TEST_DURATION_TIME));
|
2020-08-06 02:44:17 +08:00
|
|
|
};
|
|
|
|
module.exports = exports = virtualizedListTest;
|