test(e2e): sweep the binding names a spec calls
Four specs still called `library.Library.GetTracks` after #281 replaced it, and the suite reported twenty failures across transport, bottom-bar and reduced-motion specs — none of which mention the library list. A binding call carries only a method id, so a stale name fails at runtime in whichever spec happens to call it. `binding-names.spec.ts` reads every spec and harness file, extracts the names they pass as strings, and checks them against the map derived from the generated bindings tree. It asserts first that it read something: a sweep over an empty glob passes and proves nothing. It immediately found a second thing: `play-count.spec.ts` asserted that a play refetched no collection by matching a `GetAll` prefix, which matches exactly one real name (`GetAllLibrariesWithTrackCounts`) — so the assertion held whatever the app refetched. It names the four collection bindings now.
This commit is contained in:
1 parent
2ed9e725e3
commit
655434dcaa
8 files changed
+149
-46
No files matched your search
@@ -40,6 +40,21 @@ const FINISH_TIMEOUT = 60_000;
|
||||
const libraryCalls = async (app: Page): Promise<string[]> =>
|
||||
(await bindingCalls(app)).filter((c) => c.startsWith('library.Library.'));
|
||||
|
||||
/**
|
||||
* The bindings that fetch a collection.
|
||||
*
|
||||
* A prefix test (GetAll*) used to stand in for this, and matched
|
||||
* exactly one name — GetAllLibrariesWithTrackCounts — so the assertion
|
||||
* below held whatever the app refetched. The sweep in
|
||||
* binding-names.spec.ts is what found it.
|
||||
*/
|
||||
const COLLECTION_FETCHES = [
|
||||
'library.Library.GetTrackTable',
|
||||
'library.Library.GetAlbums',
|
||||
'library.Library.GetArtists',
|
||||
'library.Library.GetGenres',
|
||||
];
|
||||
|
||||
/**
|
||||
* Select rows by dispatching on the row rather than clicking it.
|
||||
*
|
||||
@@ -116,7 +131,7 @@ test.describe('a finished track', () => {
|
||||
const refetched = await libraryCalls(app);
|
||||
|
||||
expect(
|
||||
refetched.filter((c) => c.startsWith('library.Library.GetAll')),
|
||||
refetched.filter((c) => COLLECTION_FETCHES.includes(c)),
|
||||
'a play refetched a collection',
|
||||
).toEqual([]);
|
||||
|
||||
|
||||
Reference in new issue
Block a user