Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
KingSora committed Jun 10, 2024
1 parent 6107539 commit 75243d3
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ let OverlayScrollbars = originalOverlayScrollbars;
describe('overlayscrollbars', () => {
beforeEach(async () => {
jest.resetModules();
jest.doMock('~/support/dom/dimensions', () => {
const originalModule = jest.requireActual('~/support/dom/dimensions');
return {
...originalModule,
hasDimensions: jest.fn().mockImplementation(() => true),
};
});
({ OverlayScrollbars } = await import('~/overlayscrollbars'));
});

Expand Down Expand Up @@ -681,6 +688,7 @@ describe('overlayscrollbars', () => {
beforeEach(async () => {
document.body.innerHTML = '';

jest.resetModules();
jest.doMock('~/support', () => {
const originalModule = jest.requireActual('~/support');
return {
Expand All @@ -700,6 +708,8 @@ describe('overlayscrollbars', () => {
OverlayScrollbars.nonce('abc');
OverlayScrollbars.env();

console.log(document.body.innerHTML);

expect(document.body.querySelector('style')?.nonce).toBe('abc');
});
});
Expand Down

0 comments on commit 75243d3

Please sign in to comment.