test: cover jobs in Settings, and unpick two shared selectors
The spec worth having is not that the tab is gone -- that is one line of a table -- but that nothing became unreachable when it went. #24 promises that no action is ever unreachable at any supported size, and deleting a destination is exactly the change that quietly breaks it. Two existing selectors had to give. `config-section .header` is ambiguous the moment a section holds a job, because `job-details-drawer` carries that class too -- so `settings-reach.spec.ts` locates a disclosure by role and name instead. And `page-header`'s and `offline-icons`'s view lists lose an entry each. Closes #27
This commit is contained in:
@@ -63,7 +63,6 @@ describe('<app-sidebar>', () => {
|
||||
'nav-explore',
|
||||
'nav-downloads',
|
||||
'nav-autotag',
|
||||
'nav-jobs',
|
||||
'nav-settings',
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -49,7 +49,7 @@ describe('<app-sidebar> is reachable', () => {
|
||||
|
||||
const items = shadowAll(el, 'li button');
|
||||
|
||||
expect(items).toHaveLength(11);
|
||||
expect(items).toHaveLength(10);
|
||||
expect(items.every((item) => item.tagName === 'BUTTON')).toBe(true);
|
||||
});
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ import '@components/jobs/job-details-drawer';
|
||||
import '@components/jobs/job-indicator';
|
||||
import '@components/jobs/job-log-view';
|
||||
import '@components/jobs/job-row';
|
||||
import '@components/jobs/jobs-view';
|
||||
import '@components/jobs/job-panel';
|
||||
import '@components/library-filter/library-filter';
|
||||
import '@components/library-status-indicator/library-status-indicator';
|
||||
import '@components/now-playing/now-playing';
|
||||
@@ -87,8 +87,8 @@ const TAGS = [
|
||||
'job-details-drawer',
|
||||
'job-indicator',
|
||||
'job-log-view',
|
||||
'job-panel',
|
||||
'job-row',
|
||||
'jobs-view',
|
||||
'library-filter',
|
||||
'library-status-indicator',
|
||||
'now-playing',
|
||||
|
||||
@@ -27,7 +27,6 @@ import '@components/explore-view/explore-view';
|
||||
import '@components/home-view/home-view';
|
||||
import '@components/downloads-view/downloads-view';
|
||||
|
||||
import '@components/jobs/jobs-view';
|
||||
import '@components/playlist-view/playlist-view';
|
||||
import { fixture } from '@test/support/render';
|
||||
import { stub, flush } from '@test/support/harness';
|
||||
@@ -223,7 +222,6 @@ const CACHED_VIEWS = [
|
||||
'artists-view',
|
||||
'genres-view',
|
||||
'downloads-view',
|
||||
'jobs-view',
|
||||
'playlist-view',
|
||||
'explore-view',
|
||||
'home-view',
|
||||
|
||||
@@ -72,7 +72,6 @@ const ALL_VISIBLE = {
|
||||
explore: true,
|
||||
downloads: true,
|
||||
autotag: true,
|
||||
jobs: true,
|
||||
settings: true,
|
||||
};
|
||||
|
||||
@@ -96,7 +95,6 @@ describe('view visibility', () => {
|
||||
'explore',
|
||||
'downloads',
|
||||
'autotag',
|
||||
'jobs',
|
||||
'settings',
|
||||
]);
|
||||
});
|
||||
@@ -104,11 +102,11 @@ describe('view visibility', () => {
|
||||
it('drops the ones the user switched off', async () => {
|
||||
const el = await fixture<LitElement>('app-sidebar');
|
||||
|
||||
await setViews({ ...ALL_VISIBLE, autotag: false, jobs: false });
|
||||
await setViews({ ...ALL_VISIBLE, autotag: false, explore: false });
|
||||
await el.updateComplete;
|
||||
|
||||
expect(navIDs(el)).not.toContain('autotag');
|
||||
expect(navIDs(el)).not.toContain('jobs');
|
||||
expect(navIDs(el)).not.toContain('explore');
|
||||
expect(navIDs(el)).toContain('settings');
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user