Commit 6dfa1a9
authored
feat(frontend): unify feed/result state flow (#943)
## Summary
- unify guest/member/result flow around a consistent dominant-field
interaction model
- refine app panels and result display behavior for readiness and retry
states
- align related frontend hooks/api wiring and test coverage with the
updated UI state contract
- rename frontend type entrypoint from env.d.ts to environment.d.ts
This pull request updates and improves the frontend test suites for the
application, focusing on consistency in terminology, better test
reliability, and improved clarity in test expectations. The changes
include standardizing user-facing text in tests, switching from `window`
to `globalThis` for global objects, and updating test logic to match
recent UI and API changes.
Most important changes:
**Terminology and Text Consistency:**
* Standardized the access token prompt from "Add access token" to "Enter
access token" across all relevant tests, ensuring consistency with the
application's UI.
[[1]](diffhunk://#diff-41620153491a2a4a4ebddd835700a5287e416230bd73f3e964afe00f889f8e31L59-R59)
[[2]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L166-R179)
[[3]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L367-R374)
[[4]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L429-R440)
* Updated test expectations to use new user-facing messages, such as
changing "Feed generation failed" to "Could not create feed link", "Your
feed is ready" to "Feed ready", and other similar updates for clarity
and consistency.
[[1]](diffhunk://#diff-0f9368690552ac79a208dde6e3f09cf9f4e350e910d0de10c35dc2cc235479b1L67-R67)
[[2]](diffhunk://#diff-0f9368690552ac79a208dde6e3f09cf9f4e350e910d0de10c35dc2cc235479b1L162-R164)
[[3]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L252-R287)
[[4]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L397-R404)
[[5]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L212-R217)
**Test Reliability and Modernization:**
* Replaced usage of `window` with `globalThis` for accessing global
objects like `localStorage` and `history` in tests, improving
compatibility and reliability in different testing environments.
[[1]](diffhunk://#diff-0f9368690552ac79a208dde6e3f09cf9f4e350e910d0de10c35dc2cc235479b1L11-R11)
[[2]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14R37-R49)
[[3]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L147-R154)
[[4]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L419-R426)
[[5]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L429-R440)
* Changed test selectors from `document.getElementById` to
`document.querySelector` for improved robustness and flexibility in
selecting DOM elements.
[[1]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L166-R179)
[[2]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L338-R345)
[[3]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L409-R416)
**Test Data and Mocking Improvements:**
* Updated all mock return values in tests to use `undefined` instead of
`null` for uninitialized or missing values, aligning with current code
conventions.
[[1]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14R37-R49)
[[2]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L68-R78)
[[3]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L86-R87)
[[4]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L130-R131)
[[5]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L202-R207)
[[6]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L233-R245)
[[7]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L252-R287)
[[8]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L290-R297)
[[9]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L308-R326)
[[10]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L355-R362)
[[11]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L383-R390)
[[12]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L445-R460)
[[13]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L481-R488)
[[14]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L507-R514)
**UI and UX Flow Adjustments:**
* Updated test logic to match new UI flows, such as changing error
handling and retry button labels from "Try ... instead" to "Retry with
...", and updating messages about feed creation and readiness.
[[1]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L252-R287)
[[2]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L462-R470)
[[3]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L497-R504)
**Minor Test and Code Cleanups:**
* Removed unused imports (e.g., `h` from `preact`) and improved array
creation for utility items in tests for better readability.
[[1]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L3)
[[2]](diffhunk://#diff-1f633b86af4bf00bbb33177b2e1a51a960711d1bb9901ce853b34e53d6bd7d14L308-R326)
These changes collectively improve test accuracy, maintainability, and
ensure that tests reflect the current application behavior and user
interface.1 parent 424fb0a commit 6dfa1a9
25 files changed
Lines changed: 1116 additions & 653 deletions
File tree
- frontend
- e2e
- src
- __tests__
- api
- components
- hooks
- styles
- utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
163 | | - | |
164 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
0 commit comments