Skip to content

Commit 68a7b8a

Browse files
author
Gérard Collin
committed
fix: host tests
1 parent ca817bb commit 68a7b8a

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

apps/xt-host/projects/host/src/app/entity-manager/entity-manager.component.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,9 @@ describe('EntityManagerComponent', () => {
196196

197197
//expect(deleteSpy).toHaveBeenCalledOnce();
198198
list = harness.fixture.debugElement.query(By.directive(Table));
199-
const rows = list.queryAll(By.css('tbody tr'));
200-
expect(rows).toHaveLength(0);
199+
expect(list).toBeNull();
200+
/*const rows = list.queryAll(By.css('tbody tr'));
201+
expect(rows).toHaveLength(0);*/
201202

202203
});
203204

apps/xt-host/projects/host/src/test-setup.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,20 @@ const ResizeObserverMock = vi.fn(class {
1818
// Stub the global ResizeObserver
1919
vi.stubGlobal('ResizeObserver', ResizeObserverMock);
2020

21+
Object.defineProperty(window, 'matchMedia', {
22+
writable: true,
23+
value: vi.fn().mockImplementation(query => ({
24+
matches: false,
25+
media: query,
26+
onchange: null,
27+
addListener: vi.fn(), // deprecated
28+
removeListener: vi.fn(), // deprecated
29+
addEventListener: vi.fn(),
30+
removeEventListener: vi.fn(),
31+
dispatchEvent: vi.fn(),
32+
})),
33+
});
34+
2135
@NgModule({
2236
imports: [BrowserTestingModule],
2337
providers: [provideZonelessChangeDetection()],

0 commit comments

Comments
 (0)