Skip to content

Commit b50482e

Browse files
committed
feat(frontend): unify feed/result state flow
1 parent 424fb0a commit b50482e

24 files changed

Lines changed: 1110 additions & 649 deletions

frontend/src/__tests__/App.contract.test.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('App contract', () => {
88
const token = 'contract-token';
99

1010
const authenticate = () => {
11-
window.localStorage.setItem('html2rss_access_token', token);
11+
globalThis.localStorage.setItem('html2rss_access_token', token);
1212
};
1313

1414
it('shows feed result when API responds with success', async () => {
@@ -64,7 +64,7 @@ describe('App contract', () => {
6464
fireEvent.click(screen.getByRole('button', { name: 'Generate feed URL' }));
6565

6666
await waitFor(() => {
67-
expect(screen.getByText('Your feed is ready')).toBeInTheDocument();
67+
expect(screen.getByText('Feed ready')).toBeInTheDocument();
6868
expect(screen.getByText('Example Feed')).toBeInTheDocument();
6969
expect(screen.getByLabelText('Feed URL')).toBeInTheDocument();
7070
expect(screen.getByRole('button', { name: 'Copy feed URL' })).toBeInTheDocument();
@@ -159,8 +159,8 @@ describe('App contract', () => {
159159

160160
await screen.findByText('Access token was rejected. Paste a valid token to continue.');
161161

162-
expect(screen.getByText('Add access token')).toBeInTheDocument();
163-
expect(screen.queryByText('Feed generation failed')).not.toBeInTheDocument();
164-
expect(window.localStorage.getItem('html2rss_access_token')).toBeNull();
162+
expect(screen.getByText('Enter access token')).toBeInTheDocument();
163+
expect(screen.queryByText('Could not create feed link')).not.toBeInTheDocument();
164+
expect(globalThis.localStorage.getItem('html2rss_access_token')).toBeNull();
165165
});
166166
});

0 commit comments

Comments
 (0)