Skip to content

Commit

Permalink
Fixed matchMedia tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Nov 21, 2023
1 parent 72e0e37 commit 4092e43
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions components/lib/config/PrimeVue.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ config.global.mocks['$primevue'] = {
config: defaultOptions
};

Object.defineProperty(window, 'matchMedia', {
writable: true,
value: vi.fn().mockImplementation((query) => ({
matches: false,
media: query,
onchange: null,
addEventListener: vi.fn(),
removeEventListener: vi.fn()
}))
});

describe('PrimeVue.vue', () => {
it('should exist', async () => {});
});

0 comments on commit 4092e43

Please sign in to comment.