implement tests

This commit is contained in:
Alex Shnitman
2026-03-20 13:12:31 +02:00
parent 0bf508dbc6
commit a1f2fe3e73
21 changed files with 1750 additions and 388 deletions
+12 -17
View File
@@ -1,24 +1,20 @@
import { TestBed } from '@angular/core/testing';
import { App } from './app';
vi.hoisted(() => {
Object.defineProperty(window, "matchMedia", {
writable: true,
enumerable: true,
value: vi.fn().mockImplementation((query) => ({
matches: false,
media: query,
onchange: null,
addEventListener: vi.fn(),
removeEventListener: vi.fn(),
dispatchEvent: vi.fn(),
})),
});
});
describe('App', () => {
beforeEach(async () => {
Object.defineProperty(window, 'matchMedia', {
writable: true,
enumerable: true,
value: vi.fn().mockImplementation((query: string) => ({
matches: false,
media: query,
onchange: null,
addEventListener: vi.fn(),
removeEventListener: vi.fn(),
dispatchEvent: vi.fn(),
})),
});
await TestBed.configureTestingModule({
imports: [App],
}).compileComponents();
@@ -29,5 +25,4 @@ describe('App', () => {
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});
});