Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Mar 29, 2021
1 parent 4f2bbb6 commit 8c8bc14
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,42 @@ describe('Prefresh integrations', () => {
await page.$eval('#color', e => getComputedStyle(e).backgroundColor)
).toBe('rgb(255, 255, 255)');
});

if (integration === 'webpack') {
test('can update in-file HOCs', async () => {
const listItems = await page.$('#item-list');
let children = await storeItems.$$('div');

expect(children.length).toEqual(4);
expect(await getText(children[0])).toMatch('item 0');
expect(await getText(children[1])).toMatch('item 1');

await updateFile('src/listItem.jsx', content =>
content.replace(
'item {this.props.index}',
'items {this.props.index}'
)
);
await timeout(TIMEOUT);

children = await storeItems.$$('li');
expect(children.length).toEqual(4);
expect(await getText(children[0])).toMatch('items 0');
expect(await getText(children[1])).toMatch('items 1');

await updateFile('src/listItem.jsx', content =>
content.replace(
'items {this.props.index}',
'item {this.props.index} --'
)
);
await timeout(TIMEOUT);
children = await storeItems.$$('li');
expect(children.length).toEqual(4);
expect(await getText(children[0])).toMatch('items 0 --');
expect(await getText(children[1])).toMatch('items 1 --');
});
}
});
});
});

0 comments on commit 8c8bc14

Please sign in to comment.