mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-03 17:41:51 +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:
@@ -4,6 +4,7 @@ import userEvent from '@testing-library/user-event';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
import { render, screen, waitFor, within } from '../../../tests/helpers/render';
|
||||
import { server } from '../../../tests/helpers/msw/server';
|
||||
import { locationAt } from '../../../tests/helpers/location';
|
||||
import { ToastContainer } from '../shared/Toast';
|
||||
import { usePluginStore, type ActivePlugin } from '../../store/pluginStore';
|
||||
import type { PluginAction, PluginUserSettingField } from '../../api/client';
|
||||
@@ -367,7 +368,7 @@ describe('PluginSettingsTab', () => {
|
||||
|
||||
it('FE-COMP-PLUGINSETTINGS-020: an OAuth-only plugin gets a card and Connect hands off to the provider', async () => {
|
||||
const user = userEvent.setup();
|
||||
const loc = { href: 'http://localhost/settings', origin: 'http://localhost', pathname: '/settings' };
|
||||
const loc = locationAt('/settings');
|
||||
vi.stubGlobal('location', loc);
|
||||
serve('weather', {}, { configured: true, connected: false });
|
||||
server.use(http.post('/api/plugin-oauth/weather/connect', () =>
|
||||
|
||||
Reference in New Issue
Block a user