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:
@@ -124,7 +124,10 @@ describe('AppBarScoreBadge', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('navigates to /polaris when no cluster in URL', async () => {
|
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 user = userEvent.setup();
|
||||||
const data = makeAuditData([
|
const data = makeAuditData([
|
||||||
makeResult({
|
makeResult({
|
||||||
|
|||||||
Reference in New Issue
Block a user