Skip to content

Commit

Permalink
✔️ Updating other tests that use deviceSupport composable
Browse files Browse the repository at this point in the history
  • Loading branch information
MiloradFilipovic committed Jun 10, 2024
1 parent 2fce82c commit bafe846
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ describe('NodeDetailsView', () => {

beforeAll(() => {
server = setupServer();
// Mocks for useDeviceSupport
Object.defineProperty(window, 'matchMedia', { value: vi.fn().mockImplementation(() => true) });
});

afterEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ describe('useCanvasPanning()', () => {
let element: HTMLElement;
let elementRef: Ref<null | HTMLElement>;

beforeAll(() => {
// Mocks for useDeviceSupport
Object.defineProperty(window, 'matchMedia', { value: vi.fn().mockImplementation(() => true) });
});

beforeEach(() => {
element = document.createElement('div');
element.id = 'node-view';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ const TestComponent = defineComponent({
});

describe('useHistoryHelper', () => {
beforeAll(() => {
// Mocks for useDeviceSupport
Object.defineProperty(window, 'matchMedia', { value: vi.fn().mockImplementation(() => true) });
});

beforeEach(() => {
undoMock.mockClear();
redoMock.mockClear();
Expand Down

0 comments on commit bafe846

Please sign in to comment.