fix: use Object.defineProperty for window.location in test

Replace `as Location` cast with Object.defineProperty to match the
existing beforeEach pattern and fix TypeScript strict mode error.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Gandalf the Greybeard
2026-03-17 00:39:56 +00:00
parent 9241655c02
commit 8def942917
+4 -1
View File
@@ -124,7 +124,10 @@ describe('AppBarScoreBadge', () => {
});
it('navigates to /polaris when no cluster in URL', async () => {
window.location = { pathname: '/settings' } as Location;
Object.defineProperty(window, 'location', {
value: { pathname: '/settings' },
writable: true,
});
const user = userEvent.setup();
const data = makeAuditData([
makeResult({