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
@@ -2,6 +2,7 @@ import {
|
||||
test,
|
||||
expect,
|
||||
callBinding,
|
||||
libraryTracks,
|
||||
waitForEvent,
|
||||
NO_QUEUE_SOURCE,
|
||||
} from '../support/fixtures.js';
|
||||
@@ -56,20 +57,9 @@ async function playTheLongOne(app: Page): Promise<void> {
|
||||
window.dispatchEvent(new CustomEvent('yj-scroll-mode-changed'));
|
||||
});
|
||||
|
||||
const paths: string[] = await app.evaluate(async (needle) => {
|
||||
// One argument, and 0 means every library: the scoped and
|
||||
// unscoped list queries collapsed into one when the schema did
|
||||
// (plan 013 R3), so `GetTracks()` no longer exists to call.
|
||||
const tracks = await window.__yjEvents.call(
|
||||
'library.Library.GetTracks',
|
||||
[0],
|
||||
10_000,
|
||||
);
|
||||
|
||||
return (tracks as { TrackName: string; FilePath: string }[])
|
||||
.filter((t) => t.TrackName.startsWith(needle))
|
||||
.map((t) => t.FilePath);
|
||||
}, LONG_TITLE);
|
||||
const paths: string[] = (await libraryTracks(app))
|
||||
.filter((t) => t.TrackName.startsWith(LONG_TITLE))
|
||||
.map((t) => t.FilePath);
|
||||
|
||||
expect(paths.length).toBeGreaterThan(0);
|
||||
|
||||
|
||||
Reference in new issue
Block a user