Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
Günthermann, C. (Clemens) authored and Günthermann, C. (Clemens) committed Aug 28, 2024
1 parent 7c8d8f5 commit 6f0b891
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions packages/ui/components/overlays/test/OverlayController.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1765,24 +1765,32 @@ describe('OverlayController', () => {
});
});

describe('run _keepBodySize only with global placement', () => {
describe('run _keepBodySize only with scroll prevention', () => {
/**
* @type {OverlayController}
*/
const overlayControllerLocal = new OverlayController({
const overlayControllerNoPrevent = new OverlayController({
...withLocalTestConfig(),
preventsScroll: false,
});

it('should not run with local placement', async () => {
await overlayControllerLocal.show();
const overlayControllerPreventsScroll = new OverlayController({
...withLocalTestConfig(),
preventsScroll: true,
});

it('should not run with scroll prevention', async () => {
await overlayControllerNoPrevent.show();

expect(overlayControllerNoPrevent.__bodyMarginRightInline).to.equal(undefined);
expect(overlayControllerNoPrevent.__bodyMarginRight).to.equal(undefined);
});

it('should run with scroll prevention', async () => {
await overlayControllerPreventsScroll.show();

expect(overlayControllerLocal.__bodyMarginRightInline).to.equal(undefined);
expect(overlayControllerLocal.__bodyMarginRight).to.equal(undefined);

overlayControllerLocal.updateConfig({ preventsScroll: true });
expect(overlayControllerLocal.__bodyMarginRightInline).to.not.equal(undefined);
expect(overlayControllerLocal.__bodyMarginRight).to.not.equal(undefined);
expect(overlayControllerPreventsScroll.__bodyMarginRightInline).to.not.equal(undefined);
expect(overlayControllerPreventsScroll.__bodyMarginRight).to.not.equal(undefined);
});
});
});

0 comments on commit 6f0b891

Please sign in to comment.