fix(web): ensure tooltips and menus don't cause scrollbar reflow

This commit is contained in:
Paul Armstrong
2021-02-23 09:10:55 -08:00
committed by Blake Blackshear
parent 3c60aeeef9
commit 5043040530
3 changed files with 44 additions and 30 deletions

View File

@@ -26,8 +26,8 @@ describe('Tooltip', () => {
const tooltip = await screen.findByRole('tooltip');
const style = window.getComputedStyle(tooltip);
expect(style.left).toEqual('105px');
expect(style.top).toEqual('70px');
expect(style.left).toEqual('103px');
expect(style.top).toEqual('68.5px');
});
test('if too far right, renders to the left', async () => {
@@ -54,7 +54,7 @@ describe('Tooltip', () => {
const tooltip = await screen.findByRole('tooltip');
const style = window.getComputedStyle(tooltip);
expect(style.left).toEqual('942px');
expect(style.left).toEqual('937px');
expect(style.top).toEqual('97px');
});
@@ -109,7 +109,7 @@ describe('Tooltip', () => {
const tooltip = await screen.findByRole('tooltip');
const style = window.getComputedStyle(tooltip);
expect(style.left).toEqual('87px');
expect(style.top).toEqual('160px');
expect(style.left).toEqual('84px');
expect(style.top).toEqual('158.5px');
});
});