@internetarchive/ia-item-navigator 0.0.0-a9 → 0.0.2-a2
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +29 -19
- package/demo/app-root.ts +37 -31
- package/demo/index.html +1 -0
- package/dist/demo/app-root.d.ts +11 -15
- package/dist/demo/app-root.js +26 -26
- package/dist/demo/app-root.js.map +1 -1
- package/dist/src/interfaces/custom-theater-interface.d.ts +20 -0
- package/dist/src/interfaces/custom-theater-interface.js +2 -0
- package/dist/src/interfaces/custom-theater-interface.js.map +1 -0
- package/dist/src/interfaces/event-interfaces.d.ts +11 -11
- package/dist/src/interfaces/event-interfaces.js.map +1 -1
- package/dist/src/interfaces/menu-interfaces.d.ts +6 -7
- package/dist/src/interfaces/menu-interfaces.js.map +1 -1
- package/dist/src/interfaces/nav-controller-interface.d.ts +11 -6
- package/dist/src/interfaces/nav-controller-interface.js.map +1 -1
- package/dist/src/item-inspector/item-inspector.d.ts +0 -47
- package/dist/src/item-inspector/item-inspector.js +253 -271
- package/dist/src/item-inspector/item-inspector.js.map +1 -1
- package/dist/src/item-navigator.d.ts +41 -28
- package/dist/src/item-navigator.js +96 -113
- package/dist/src/item-navigator.js.map +1 -1
- package/dist/src/no-theater-available.d.ts +9 -0
- package/dist/src/no-theater-available.js +79 -0
- package/dist/src/no-theater-available.js.map +1 -0
- package/dist/test/book-nav-stub.d.ts +22 -0
- package/dist/test/book-nav-stub.js +49 -0
- package/dist/test/book-nav-stub.js.map +1 -0
- package/dist/test/ia-item-navigator.test.d.ts +1 -0
- package/dist/test/ia-item-navigator.test.js +279 -131
- package/dist/test/ia-item-navigator.test.js.map +1 -1
- package/dist/test/ia-stub.d.ts +22 -0
- package/dist/test/ia-stub.js +34 -3
- package/dist/test/ia-stub.js.map +1 -1
- package/dist/test/no-theater-available.test.d.ts +1 -0
- package/dist/test/no-theater-available.test.js +27 -0
- package/dist/test/no-theater-available.test.js.map +1 -0
- package/package.json +4 -3
- package/src/interfaces/custom-theater-interface.ts +28 -0
- package/src/interfaces/event-interfaces.ts +15 -11
- package/src/interfaces/menu-interfaces.ts +9 -10
- package/src/item-navigator.ts +133 -144
- package/src/no-theater-available.ts +85 -0
- package/test/book-nav-stub.ts +47 -0
- package/test/ia-item-navigator.test.ts +365 -156
- package/test/ia-stub.ts +78 -2
- package/test/no-theater-available.test.ts +32 -0
- package/demo/demo-book-manifest.json +0 -1163
- package/src/interfaces/nav-controller-interface.ts +0 -18
- package/src/item-inspector/files-by-type/files-by-type-provider.ts +0 -43
- package/src/item-inspector/files-by-type/ia-files-by-type.ts +0 -100
- package/src/item-inspector/item-inspector.ts +0 -296
- package/src/item-inspector/share-provider.ts +0 -51
- package/src/item-inspector/visual-mod-provider.ts +0 -65
- package/src/item-navigator-js.js +0 -372
@@ -0,0 +1,32 @@
|
|
1
|
+
import { html, fixture, expect } from '@open-wc/testing';
|
2
|
+
import { IANoTheaterAvailable } from '../src/no-theater-available';
|
3
|
+
import '../src/no-theater-available';
|
4
|
+
|
5
|
+
describe('IANoTheaterAvailable', () => {
|
6
|
+
it('Fires `loadingStateUpdated` on identifier change', async () => {
|
7
|
+
const el = await fixture<IANoTheaterAvailable>(
|
8
|
+
html`<ia-no-theater-available
|
9
|
+
.identifier=${`foo`}
|
10
|
+
></ia-no-theater-available>`
|
11
|
+
);
|
12
|
+
let eventFired = false;
|
13
|
+
el.addEventListener('loadingStateUpdated', () => {
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
15
|
+
eventFired = true;
|
16
|
+
});
|
17
|
+
expect(eventFired).to.be.false;
|
18
|
+
|
19
|
+
el.identifier = 'bar';
|
20
|
+
await el.updateComplete;
|
21
|
+
expect(eventFired).to.be.true;
|
22
|
+
});
|
23
|
+
it('Has link to item download page', async () => {
|
24
|
+
const el = await fixture<IANoTheaterAvailable>(
|
25
|
+
html`<ia-no-theater-available
|
26
|
+
.identifier=${`foo`}
|
27
|
+
></ia-no-theater-available>`
|
28
|
+
);
|
29
|
+
expect(el.downloadUrl).to.equal('/download/foo');
|
30
|
+
expect(el?.shadowRoot?.querySelector('a')?.href).to.contain(el.downloadUrl);
|
31
|
+
});
|
32
|
+
});
|