2020-08-06 02:44:17 +08:00
|
|
|
const VirtualizedList = require('./virtualizedlist/virtualize');
|
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 {
|
|
|
|
await test.init();
|
|
|
|
response = await test.test();
|
2020-10-09 03:25:35 +08:00
|
|
|
screenshot = await test.page1.page.screenshot();
|
2020-08-06 02:44:17 +08:00
|
|
|
} catch (e) {
|
|
|
|
console.log(e);
|
|
|
|
} finally {
|
|
|
|
await test.close();
|
|
|
|
}
|
|
|
|
expect(response).toBe(true);
|
2020-10-09 03:25:35 +08:00
|
|
|
if (process.env.REGRESSION_TESTING === 'true') {
|
|
|
|
expect(screenshot).toMatchImageSnapshot({
|
|
|
|
failureThreshold: 0.005,
|
|
|
|
failureThresholdType: 'percent',
|
|
|
|
});
|
|
|
|
}
|
2020-08-06 02:44:17 +08:00
|
|
|
}, parseInt(process.env.TEST_DURATION_TIME));
|
|
|
|
};
|
|
|
|
module.exports = exports = virtualizedListTest;
|