test(frontend): cover the lifecycle, the voice and the repaints
Component and store cases for everything in this series, several of which exist because the thing they pin is invisible everywhere else: - `view-lifecycle` and `keyboard-reach` — a document listener count that does not grow across a simulated navigate cycle, and a tab sequence that reaches the sidebar and plays a row without a mouse. - `notifications`, `notification-store`, `confirm-dialog`, `empty-states` — the four levels, the (level, region, key) coalescing window, and loading/failed/empty as three states. - `card-grid-repaint` — fails if `artists-view`'s or `genres-view`'s per-render arrow functions are hoisted to stable fields, which is the audit's own recommendation and takes the cards from 1 highlighted to 0. It exists for no other reason. - `lazy-track-details` — reads the five sources and fails on a returning static import, the same shape as `TestNoDirectRuntimeEmits` and for the same reason: the invariant is about what the code does *not* say. - `now-playing` — a position report that changes nothing must not touch the DOM again, and a track change must. The first fails against the old unconditional `updated()`. - `playlist-virtualization`, `list-render-cost`, `selection`, `icons`, and the store cases for the library-filter race, the never-settling waiter and the per-playlist patch.
This commit is contained in:
@@ -25,7 +25,9 @@ describe('<app-sidebar>', () => {
|
||||
const el = await fixture('app-sidebar');
|
||||
|
||||
expect(
|
||||
shadowAll(el, 'li').map((li) => li.getAttribute('data-testid')),
|
||||
shadowAll(el, 'li button').map((item) =>
|
||||
item.getAttribute('data-testid'),
|
||||
),
|
||||
).toEqual([
|
||||
'nav-home',
|
||||
'nav-playlists',
|
||||
@@ -44,8 +46,8 @@ describe('<app-sidebar>', () => {
|
||||
it('marks exactly one item as the current page', async () => {
|
||||
const el = await fixture('app-sidebar');
|
||||
|
||||
const current = shadowAll(el, 'li').filter(
|
||||
(li) => li.getAttribute('aria-current') === 'page',
|
||||
const current = shadowAll(el, 'li button').filter(
|
||||
(item) => item.getAttribute('aria-current') === 'page',
|
||||
);
|
||||
|
||||
expect(current).toHaveLength(1);
|
||||
|
||||
Reference in New Issue
Block a user