mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-02 09:22:15 +00:00
test(client): finish moving the tests to msw 3
Two more window.location stand-ins sat on http://localhost while the page runs on http://localhost:3000; they now use locationAt like the rest, which brings back the plugin settings answer FE-COMP- PLUGINSETTINGS-020 waits for. FE-PAGE-JOURNEYDETAIL-153 ended while the journal reload it set off was still out, which timed out after the test; it now waits for that read. The reload mocks in versionHandover.test.ts carry the signatures of location.replace and location.reload, as locationAt's overrides require.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// FE-COMP-PLUGIN-USERSET-001 to -012: the per plugin user settings logic both settings shells share.
|
||||
import { act, renderHook, waitFor } from '@testing-library/react';
|
||||
import { locationAt } from '../../../tests/helpers/location';
|
||||
import { pluginsApi, type PluginAction, type PluginUserSettingField } from '../../api/client';
|
||||
import { SECRET_MASK } from './settingsForm';
|
||||
import { usePluginOAuth, usePluginUserSettings } from './usePluginUserSettings';
|
||||
@@ -150,7 +151,7 @@ describe('usePluginOAuth', () => {
|
||||
|
||||
it('FE-COMP-PLUGIN-USERSET-012: a connect hands off to the provider and keeps the button busy', async () => {
|
||||
const realLocation = window.location;
|
||||
const loc = { href: 'http://localhost/settings' };
|
||||
const loc = locationAt('/settings');
|
||||
Object.defineProperty(window, 'location', { writable: true, configurable: true, value: loc });
|
||||
try {
|
||||
vi.spyOn(pluginsApi, 'oauthConnect').mockResolvedValue({
|
||||
|
||||
Reference in New Issue
Block a user