@pod-os/elements 0.13.1-9efc307.0 → 0.13.1-cd22eb8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/elements.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -3
- package/dist/elements/elements.esm.js +1 -1
- package/dist/elements/elements.esm.js.map +1 -1
- package/dist/esm/elements.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components.d.ts +0 -13
- package/package.json +1 -1
- package/dist/cjs/test-component.cjs.entry.js +0 -15
- package/dist/cjs/test-component.cjs.entry.js.map +0 -1
- package/dist/collection/apps/pos-app-document-viewer/pos-app-document-viewer.spec.js +0 -29
- package/dist/collection/apps/pos-app-document-viewer/pos-app-document-viewer.spec.js.map +0 -1
- package/dist/collection/apps/pos-app-image-viewer/pos-app-image-viewer.spec.js +0 -29
- package/dist/collection/apps/pos-app-image-viewer/pos-app-image-viewer.spec.js.map +0 -1
- package/dist/collection/components/broken-file/BrokenFile.spec.js +0 -45
- package/dist/collection/components/broken-file/BrokenFile.spec.js.map +0 -1
- package/dist/collection/components/pos-add-literal-value/test/pos-add-literal-value.spec.js +0 -185
- package/dist/collection/components/pos-add-literal-value/test/pos-add-literal-value.spec.js.map +0 -1
- package/dist/collection/components/pos-add-new-thing/test/pos-add-new-thing.spec.js +0 -59
- package/dist/collection/components/pos-add-new-thing/test/pos-add-new-thing.spec.js.map +0 -1
- package/dist/collection/components/pos-container-contents/pos-container-contents.spec.js +0 -132
- package/dist/collection/components/pos-container-contents/pos-container-contents.spec.js.map +0 -1
- package/dist/collection/components/pos-container-contents/pos-container-item.spec.js +0 -64
- package/dist/collection/components/pos-container-contents/pos-container-item.spec.js.map +0 -1
- package/dist/collection/components/pos-container-contents/selectIconForTypes.spec.js +0 -30
- package/dist/collection/components/pos-container-contents/selectIconForTypes.spec.js.map +0 -1
- package/dist/collection/components/pos-description/pos-description.spec.js +0 -31
- package/dist/collection/components/pos-description/pos-description.spec.js.map +0 -1
- package/dist/collection/components/pos-document/pos-document.spec.js +0 -219
- package/dist/collection/components/pos-document/pos-document.spec.js.map +0 -1
- package/dist/collection/components/pos-error-toast/test/pos-error-toast.spec.js +0 -18
- package/dist/collection/components/pos-error-toast/test/pos-error-toast.spec.js.map +0 -1
- package/dist/collection/components/pos-image/pos-image.integration.spec.js +0 -124
- package/dist/collection/components/pos-image/pos-image.integration.spec.js.map +0 -1
- package/dist/collection/components/pos-image/pos-image.spec.js +0 -219
- package/dist/collection/components/pos-image/pos-image.spec.js.map +0 -1
- package/dist/collection/components/pos-label/pos-label.integration.spec.js +0 -101
- package/dist/collection/components/pos-label/pos-label.integration.spec.js.map +0 -1
- package/dist/collection/components/pos-label/pos-label.spec.js +0 -31
- package/dist/collection/components/pos-label/pos-label.spec.js.map +0 -1
- package/dist/collection/components/pos-literals/pos-literals.spec.js +0 -118
- package/dist/collection/components/pos-literals/pos-literals.spec.js.map +0 -1
- package/dist/collection/components/pos-login/pos-login.integration.spec.js +0 -35
- package/dist/collection/components/pos-login/pos-login.integration.spec.js.map +0 -1
- package/dist/collection/components/pos-login/pos-login.spec.js +0 -46
- package/dist/collection/components/pos-login/pos-login.spec.js.map +0 -1
- package/dist/collection/components/pos-navigation-bar/pos-navigation-bar.spec.js +0 -41
- package/dist/collection/components/pos-navigation-bar/pos-navigation-bar.spec.js.map +0 -1
- package/dist/collection/components/pos-new-thing-form/test/pos-new-thing-form.spec.js +0 -239
- package/dist/collection/components/pos-new-thing-form/test/pos-new-thing-form.spec.js.map +0 -1
- package/dist/collection/components/pos-picture/pos-picture.integration.spec.js +0 -79
- package/dist/collection/components/pos-picture/pos-picture.integration.spec.js.map +0 -1
- package/dist/collection/components/pos-picture/pos-picture.spec.js +0 -49
- package/dist/collection/components/pos-picture/pos-picture.spec.js.map +0 -1
- package/dist/collection/components/pos-relations/pos-relations.spec.js +0 -64
- package/dist/collection/components/pos-relations/pos-relations.spec.js.map +0 -1
- package/dist/collection/components/pos-resource/pos-resource.integration.spec.js +0 -355
- package/dist/collection/components/pos-resource/pos-resource.integration.spec.js.map +0 -1
- package/dist/collection/components/pos-resource/pos-resource.spec.js +0 -237
- package/dist/collection/components/pos-resource/pos-resource.spec.js.map +0 -1
- package/dist/collection/components/pos-reverse-relations/pos-reverse-relations.spec.js +0 -64
- package/dist/collection/components/pos-reverse-relations/pos-reverse-relations.spec.js.map +0 -1
- package/dist/collection/components/pos-rich-link/pos-rich-link.spec.js +0 -37
- package/dist/collection/components/pos-rich-link/pos-rich-link.spec.js.map +0 -1
- package/dist/collection/components/pos-select-term/test/pos-select-term.spec.js +0 -75
- package/dist/collection/components/pos-select-term/test/pos-select-term.spec.js.map +0 -1
- package/dist/collection/components/pos-subjects/pos-subjects.spec.js +0 -58
- package/dist/collection/components/pos-subjects/pos-subjects.spec.js.map +0 -1
- package/dist/collection/components/pos-type-badges/pos-type-badges.spec.js +0 -119
- package/dist/collection/components/pos-type-badges/pos-type-badges.spec.js.map +0 -1
- package/dist/collection/components/pos-type-router/pos-type-router.spec.js +0 -105
- package/dist/collection/components/pos-type-router/pos-type-router.spec.js.map +0 -1
- package/dist/collection/components/pos-type-router/selectAppForTypes.spec.js +0 -85
- package/dist/collection/components/pos-type-router/selectAppForTypes.spec.js.map +0 -1
- package/dist/collection/components/pos-value/pos-value.spec.js +0 -31
- package/dist/collection/components/pos-value/pos-value.spec.js.map +0 -1
- package/dist/collection/test/TestComponent.js +0 -4
- package/dist/collection/test/TestComponent.js.map +0 -1
- package/dist/collection/test/mockPodOS.js +0 -38
- package/dist/collection/test/mockPodOS.js.map +0 -1
- package/dist/collection/test/renderFunctionalComponent.js +0 -9
- package/dist/collection/test/renderFunctionalComponent.js.map +0 -1
- package/dist/components/test-component.d.ts +0 -11
- package/dist/components/test-component.js +0 -9
- package/dist/components/test-component.js.map +0 -1
- package/dist/elements/p-c5bcab34.entry.js +0 -2
- package/dist/elements/p-c5bcab34.entry.js.map +0 -1
- package/dist/esm/test-component.entry.js +0 -11
- package/dist/esm/test-component.entry.js.map +0 -1
- package/dist/types/test/TestComponent.d.ts +0 -2
- package/dist/types/test/mockPodOS.d.ts +0 -13
- package/dist/types/test/renderFunctionalComponent.d.ts +0 -1
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { AvailableApps, selectAppForTypes } from "./selectAppForTypes";
|
|
2
|
-
describe('select app for types', () => {
|
|
3
|
-
it('uses generic app by default', () => {
|
|
4
|
-
const app = selectAppForTypes([]);
|
|
5
|
-
expect(app).toBe(AvailableApps.Generic);
|
|
6
|
-
});
|
|
7
|
-
it('uses generic app for unknown types', () => {
|
|
8
|
-
const app = selectAppForTypes([{ uri: 'http://example', label: 'Resource' }]);
|
|
9
|
-
expect(app).toBe(AvailableApps.Generic);
|
|
10
|
-
});
|
|
11
|
-
it.each `
|
|
12
|
-
typeUri | expectedApp
|
|
13
|
-
${'http://www.w3.org/2007/ont/link#RDFDocument'} | ${'pos-app-rdf-document'}
|
|
14
|
-
${'http://www.w3.org/ns/iana/media-types/application/pdf#Resource'} | ${'pos-app-document-viewer'}
|
|
15
|
-
${'http://purl.org/dc/terms/Image'} | ${'pos-app-image-viewer'}
|
|
16
|
-
${'http://www.w3.org/2007/ont/link#Document'} | ${'pos-app-document-viewer'}
|
|
17
|
-
${'http://www.w3.org/ns/ldp#Container'} | ${'pos-app-ldp-container'}
|
|
18
|
-
`(`selects app $expectedApp app for single type $typeUri`, ({ typeUri, expectedApp }) => {
|
|
19
|
-
const types = [{ uri: typeUri, label: 'irrelevant here' }];
|
|
20
|
-
const app = selectAppForTypes(types);
|
|
21
|
-
expect(app).toBe(expectedApp);
|
|
22
|
-
});
|
|
23
|
-
it('favours document viewer over other apps for pdf document', () => {
|
|
24
|
-
const types = [
|
|
25
|
-
{ uri: 'http://www.w3.org/ns/iana/media-types/application/pdf#Resource', label: 'Resource' },
|
|
26
|
-
{ uri: 'http://purl.org/dc/terms/Image', label: 'Image' },
|
|
27
|
-
{ uri: 'http://www.w3.org/2007/ont/link#Document', label: 'Document' },
|
|
28
|
-
{ uri: 'http://www.w3.org/ns/ldp#Resource', label: 'Resource' },
|
|
29
|
-
];
|
|
30
|
-
const app = selectAppForTypes(types);
|
|
31
|
-
expect(app).toBe(AvailableApps.DocumentViewer);
|
|
32
|
-
});
|
|
33
|
-
it('favours document viewer over other apps for html document', () => {
|
|
34
|
-
const types = [
|
|
35
|
-
{ uri: 'http://www.w3.org/ns/iana/media-types/text/html#Resource', label: 'Resource' },
|
|
36
|
-
{ uri: 'http://www.w3.org/2007/ont/link#Document', label: 'Document' },
|
|
37
|
-
{ uri: 'http://www.w3.org/2007/ont/link#WebPage', label: 'WebPage' },
|
|
38
|
-
{ uri: 'http://www.w3.org/ns/ldp#Resource', label: 'Resource' },
|
|
39
|
-
];
|
|
40
|
-
const app = selectAppForTypes(types);
|
|
41
|
-
expect(app).toBe(AvailableApps.DocumentViewer);
|
|
42
|
-
});
|
|
43
|
-
it('favours document viewer over other apps for markdown document', () => {
|
|
44
|
-
const types = [
|
|
45
|
-
{ uri: 'http://www.w3.org/ns/iana/media-types/text/markdown#Resource', label: 'Resource' },
|
|
46
|
-
{ uri: 'http://www.w3.org/2007/ont/link#Document', label: 'Document' },
|
|
47
|
-
{ uri: 'http://www.w3.org/ns/ldp#Resource', label: 'Resource' },
|
|
48
|
-
];
|
|
49
|
-
const app = selectAppForTypes(types);
|
|
50
|
-
expect(app).toBe(AvailableApps.DocumentViewer);
|
|
51
|
-
});
|
|
52
|
-
it('favours image viewer over other apps for images', () => {
|
|
53
|
-
const types = [
|
|
54
|
-
{ uri: 'http://www.w3.org/ns/iana/media-types/image/jpeg#Resource', label: 'Resource' },
|
|
55
|
-
{ uri: 'http://purl.org/dc/terms/Image', label: 'Image' },
|
|
56
|
-
{ uri: 'http://www.w3.org/2007/ont/link#Document', label: 'Document' },
|
|
57
|
-
{ uri: 'http://www.w3.org/ns/ldp#Resource', label: 'Resource' },
|
|
58
|
-
];
|
|
59
|
-
const app = selectAppForTypes(types);
|
|
60
|
-
expect(app).toBe(AvailableApps.ImageViewer);
|
|
61
|
-
});
|
|
62
|
-
it('favours rdf document app over other apps for rdf documents', () => {
|
|
63
|
-
const types = [
|
|
64
|
-
{ uri: 'http://www.w3.org/ns/iana/media-types/text/turtle#Resource', label: 'Resource' },
|
|
65
|
-
{ uri: 'http://www.w3.org/2007/ont/link#RDFDocument', label: 'RDFDocument' },
|
|
66
|
-
{ uri: 'http://www.w3.org/2007/ont/link#Document', label: 'Document' },
|
|
67
|
-
{ uri: 'http://www.w3.org/ns/ldp#Resource', label: 'Resource' },
|
|
68
|
-
];
|
|
69
|
-
const app = selectAppForTypes(types);
|
|
70
|
-
expect(app).toBe(AvailableApps.RdfDocument);
|
|
71
|
-
});
|
|
72
|
-
it('favours ldp container app over other apps for ldp containers', () => {
|
|
73
|
-
const types = [
|
|
74
|
-
{ uri: 'http://www.w3.org/ns/iana/media-types/text/turtle#Resource', label: 'Resource' },
|
|
75
|
-
{ uri: 'http://www.w3.org/2007/ont/link#RDFDocument', label: 'RDFDocument' },
|
|
76
|
-
{ uri: 'http://www.w3.org/2007/ont/link#Document', label: 'Document' },
|
|
77
|
-
{ uri: 'http://www.w3.org/ns/ldp#Resource', label: 'Resource' },
|
|
78
|
-
{ uri: 'http://www.w3.org/ns/ldp#Container', label: 'Container' },
|
|
79
|
-
{ uri: 'http://www.w3.org/ns/ldp#BasicContainer', label: 'BasicContainer' },
|
|
80
|
-
];
|
|
81
|
-
const app = selectAppForTypes(types);
|
|
82
|
-
expect(app).toBe(AvailableApps.LdpContainer);
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
//# sourceMappingURL=selectAppForTypes.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"selectAppForTypes.spec.js","sourceRoot":"","sources":["../../../../src/components/pos-type-router/selectAppForTypes.spec.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa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K,EAAE,UAAU,EAAE;MACtE,EAAE,GAAG,EAAE,mCAAmC,EAAE,KAAK,EAAE,UAAU,EAAE;MAC/D,EAAE,GAAG,EAAE,oCAAoC,EAAE,KAAK,EAAE,WAAW,EAAE;MACjE,EAAE,GAAG,EAAE,yCAAyC,EAAE,KAAK,EAAE,gBAAgB,EAAE;KAC5E,CAAC;IACF,MAAM,GAAG,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACrC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;EAC/C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { RdfType } from '@pod-os/core';\nimport { AvailableApps, selectAppForTypes } from './selectAppForTypes';\n\ndescribe('select app for types', () => {\n it('uses generic app by default', () => {\n const app = selectAppForTypes([]);\n expect(app).toBe(AvailableApps.Generic);\n });\n\n it('uses generic app for unknown types', () => {\n const app = selectAppForTypes([{ uri: 'http://example', label: 'Resource' }]);\n expect(app).toBe(AvailableApps.Generic);\n });\n\n it.each`\n typeUri | expectedApp\n ${'http://www.w3.org/2007/ont/link#RDFDocument'} | ${'pos-app-rdf-document'}\n ${'http://www.w3.org/ns/iana/media-types/application/pdf#Resource'} | ${'pos-app-document-viewer'}\n ${'http://purl.org/dc/terms/Image'} | ${'pos-app-image-viewer'}\n ${'http://www.w3.org/2007/ont/link#Document'} | ${'pos-app-document-viewer'}\n ${'http://www.w3.org/ns/ldp#Container'} | ${'pos-app-ldp-container'}\n `(`selects app $expectedApp app for single type $typeUri`, ({ typeUri, expectedApp }) => {\n const types: RdfType[] = [{ uri: typeUri, label: 'irrelevant here' }];\n const app = selectAppForTypes(types);\n expect(app).toBe(expectedApp);\n });\n\n it('favours document viewer over other apps for pdf document', () => {\n const types: RdfType[] = [\n { uri: 'http://www.w3.org/ns/iana/media-types/application/pdf#Resource', label: 'Resource' },\n { uri: 'http://purl.org/dc/terms/Image', label: 'Image' },\n { uri: 'http://www.w3.org/2007/ont/link#Document', label: 'Document' },\n { uri: 'http://www.w3.org/ns/ldp#Resource', label: 'Resource' },\n ];\n const app = selectAppForTypes(types);\n expect(app).toBe(AvailableApps.DocumentViewer);\n });\n\n it('favours document viewer over other apps for html document', () => {\n const types: RdfType[] = [\n { uri: 'http://www.w3.org/ns/iana/media-types/text/html#Resource', label: 'Resource' },\n { uri: 'http://www.w3.org/2007/ont/link#Document', label: 'Document' },\n { uri: 'http://www.w3.org/2007/ont/link#WebPage', label: 'WebPage' },\n { uri: 'http://www.w3.org/ns/ldp#Resource', label: 'Resource' },\n ];\n const app = selectAppForTypes(types);\n expect(app).toBe(AvailableApps.DocumentViewer);\n });\n\n it('favours document viewer over other apps for markdown document', () => {\n const types: RdfType[] = [\n { uri: 'http://www.w3.org/ns/iana/media-types/text/markdown#Resource', label: 'Resource' },\n { uri: 'http://www.w3.org/2007/ont/link#Document', label: 'Document' },\n { uri: 'http://www.w3.org/ns/ldp#Resource', label: 'Resource' },\n ];\n const app = selectAppForTypes(types);\n expect(app).toBe(AvailableApps.DocumentViewer);\n });\n\n it('favours image viewer over other apps for images', () => {\n const types: RdfType[] = [\n { uri: 'http://www.w3.org/ns/iana/media-types/image/jpeg#Resource', label: 'Resource' },\n { uri: 'http://purl.org/dc/terms/Image', label: 'Image' },\n { uri: 'http://www.w3.org/2007/ont/link#Document', label: 'Document' },\n { uri: 'http://www.w3.org/ns/ldp#Resource', label: 'Resource' },\n ];\n const app = selectAppForTypes(types);\n expect(app).toBe(AvailableApps.ImageViewer);\n });\n\n it('favours rdf document app over other apps for rdf documents', () => {\n const types: RdfType[] = [\n { uri: 'http://www.w3.org/ns/iana/media-types/text/turtle#Resource', label: 'Resource' },\n { uri: 'http://www.w3.org/2007/ont/link#RDFDocument', label: 'RDFDocument' },\n { uri: 'http://www.w3.org/2007/ont/link#Document', label: 'Document' },\n { uri: 'http://www.w3.org/ns/ldp#Resource', label: 'Resource' },\n ];\n const app = selectAppForTypes(types);\n expect(app).toBe(AvailableApps.RdfDocument);\n });\n\n it('favours ldp container app over other apps for ldp containers', () => {\n const types: RdfType[] = [\n { uri: 'http://www.w3.org/ns/iana/media-types/text/turtle#Resource', label: 'Resource' },\n { uri: 'http://www.w3.org/2007/ont/link#RDFDocument', label: 'RDFDocument' },\n { uri: 'http://www.w3.org/2007/ont/link#Document', label: 'Document' },\n { uri: 'http://www.w3.org/ns/ldp#Resource', label: 'Resource' },\n { uri: 'http://www.w3.org/ns/ldp#Container', label: 'Container' },\n { uri: 'http://www.w3.org/ns/ldp#BasicContainer', label: 'BasicContainer' },\n ];\n const app = selectAppForTypes(types);\n expect(app).toBe(AvailableApps.LdpContainer);\n });\n});\n"]}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { newSpecPage } from "@stencil/core/testing";
|
|
2
|
-
import { PosValue } from "./pos-value";
|
|
3
|
-
describe('pos-value', () => {
|
|
4
|
-
it('is empty initially', async () => {
|
|
5
|
-
const page = await newSpecPage({
|
|
6
|
-
components: [PosValue],
|
|
7
|
-
html: `<pos-value predicate="https://vocab.example/#term" />`,
|
|
8
|
-
});
|
|
9
|
-
expect(page.root).toEqualHtml(`
|
|
10
|
-
<pos-value predicate="https://vocab.example/#term" />
|
|
11
|
-
<mock:shadow-root></mock:shadow-root>
|
|
12
|
-
</pos-value>
|
|
13
|
-
`);
|
|
14
|
-
});
|
|
15
|
-
it('renders property value from resource', async () => {
|
|
16
|
-
const page = await newSpecPage({
|
|
17
|
-
components: [PosValue],
|
|
18
|
-
html: `<pos-value predicate="https://vocab.example/#term" />`,
|
|
19
|
-
});
|
|
20
|
-
await page.rootInstance.receiveResource({
|
|
21
|
-
anyValue: uri => `value of ${uri}`,
|
|
22
|
-
});
|
|
23
|
-
await page.waitForChanges();
|
|
24
|
-
expect(page.root).toEqualHtml(`
|
|
25
|
-
<pos-value predicate="https://vocab.example/#term" />
|
|
26
|
-
<mock:shadow-root>value of https://vocab.example/#term</mock:shadow-root>
|
|
27
|
-
</>
|
|
28
|
-
`);
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
//# sourceMappingURL=pos-value.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pos-value.spec.js","sourceRoot":"","sources":["../../../../src/components/pos-value/pos-value.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;EACzB,EAAE,CAAC,oBAAoB,EAAE,KAAK,IAAI,EAAE;IAClC,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,QAAQ,CAAC;MACtB,IAAI,EAAE,uDAAuD;KAC9D,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;GAI/B,CAAC,CAAC;EACH,CAAC,CAAC,CAAC;EAEH,EAAE,CAAC,sCAAsC,EAAE,KAAK,IAAI,EAAE;IACpD,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,QAAQ,CAAC;MACtB,IAAI,EAAE,uDAAuD;KAC9D,CAAC,CAAC;IACH,MAAM,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC;MACtC,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC,YAAY,GAAG,EAAE;KACnC,CAAC,CAAC;IACH,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;IAC5B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;GAI/B,CAAC,CAAC;EACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { PosValue } from './pos-value';\n\ndescribe('pos-value', () => {\n it('is empty initially', async () => {\n const page = await newSpecPage({\n components: [PosValue],\n html: `<pos-value predicate=\"https://vocab.example/#term\" />`,\n });\n expect(page.root).toEqualHtml(`\n <pos-value predicate=\"https://vocab.example/#term\" />\n <mock:shadow-root></mock:shadow-root>\n </pos-value>\n `);\n });\n\n it('renders property value from resource', async () => {\n const page = await newSpecPage({\n components: [PosValue],\n html: `<pos-value predicate=\"https://vocab.example/#term\" />`,\n });\n await page.rootInstance.receiveResource({\n anyValue: uri => `value of ${uri}`,\n });\n await page.waitForChanges();\n expect(page.root).toEqualHtml(`\n <pos-value predicate=\"https://vocab.example/#term\" />\n <mock:shadow-root>value of https://vocab.example/#term</mock:shadow-root>\n </>\n `);\n });\n});\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TestComponent.js","sourceRoot":"","sources":["../../../src/test/TestComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG1C,MAAM,OAAO,aAAa;;CAAG","sourcesContent":["import { Component } from '@stencil/core';\n\n@Component({ tag: 'test-component' })\nexport class TestComponent {}\n"]}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
jest.mock('../pod-os', () => ({
|
|
2
|
-
createPodOS: jest.fn(),
|
|
3
|
-
}));
|
|
4
|
-
import { when } from "jest-when";
|
|
5
|
-
import { createPodOS } from "../pod-os";
|
|
6
|
-
const alice = {
|
|
7
|
-
webId: 'https://pod.example/alice#me',
|
|
8
|
-
name: 'Alice',
|
|
9
|
-
picture: 'https://pod.example/alice/me.jpg',
|
|
10
|
-
};
|
|
11
|
-
export function mockPodOS() {
|
|
12
|
-
let trackSessionCallback = (_) => null;
|
|
13
|
-
const os = {
|
|
14
|
-
fetch: jest.fn(),
|
|
15
|
-
fetchFile: jest.fn(),
|
|
16
|
-
store: {
|
|
17
|
-
get: jest.fn(),
|
|
18
|
-
},
|
|
19
|
-
trackSession: jest.fn().mockImplementation(cb => (trackSessionCallback = cb)),
|
|
20
|
-
handleIncomingRedirect: jest.fn(),
|
|
21
|
-
login: jest.fn().mockImplementation(() => {
|
|
22
|
-
trackSessionCallback({ isLoggedIn: true, webId: alice.webId });
|
|
23
|
-
}),
|
|
24
|
-
proposeUriForNewThing: jest.fn(),
|
|
25
|
-
addNewThing: jest.fn().mockResolvedValue(void null),
|
|
26
|
-
};
|
|
27
|
-
when(os.store.get)
|
|
28
|
-
.calledWith(alice.webId)
|
|
29
|
-
.mockReturnValue({
|
|
30
|
-
label: () => alice.name,
|
|
31
|
-
picture: () => ({
|
|
32
|
-
url: alice.picture,
|
|
33
|
-
}),
|
|
34
|
-
});
|
|
35
|
-
createPodOS.mockReturnValue(os);
|
|
36
|
-
return os;
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=mockPodOS.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mockPodOS.js","sourceRoot":"","sources":["../../../src/test/mockPodOS.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC;EAC5B,WAAW,EAAE,IAAI,CAAC,EAAE,EAAE;CACvB,CAAC,CAAC,CAAC;AAEJ,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,MAAM,KAAK,GAAG;EACZ,KAAK,EAAE,8BAA8B;EACrC,IAAI,EAAE,OAAO;EACb,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AAEF,MAAM,UAAU,SAAS;EACvB,IAAI,oBAAoB,GAAG,CAAC,CAAM,EAAE,EAAE,CAAC,IAAI,CAAC;EAC5C,MAAM,EAAE,GAAG;IACT,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE;IAChB,SAAS,EAAE,IAAI,CAAC,EAAE,EAAE;IACpB,KAAK,EAAE;MACL,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE;KACf;IACD,YAAY,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,oBAAoB,GAAG,EAAE,CAAC,CAAC;IAC7E,sBAAsB,EAAE,IAAI,CAAC,EAAE,EAAE;IACjC,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,GAAG,EAAE;MACvC,oBAAoB,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;IACjE,CAAC,CAAC;IACF,qBAAqB,EAAE,IAAI,CAAC,EAAE,EAAE;IAChC,WAAW,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;GACpD,CAAC;EACF,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC;KACf,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC;KACvB,eAAe,CAAC;IACf,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI;IACvB,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;MACd,GAAG,EAAE,KAAK,CAAC,OAAO;KACnB,CAAC;GACH,CAAC,CAAC;EACJ,WAAyB,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;EAC/C,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["jest.mock('../pod-os', () => ({\n createPodOS: jest.fn(),\n}));\n\nimport { when } from 'jest-when';\nimport { createPodOS } from '../pod-os';\n\nconst alice = {\n webId: 'https://pod.example/alice#me',\n name: 'Alice',\n picture: 'https://pod.example/alice/me.jpg',\n};\n\nexport function mockPodOS() {\n let trackSessionCallback = (_: any) => null;\n const os = {\n fetch: jest.fn(),\n fetchFile: jest.fn(),\n store: {\n get: jest.fn(),\n },\n trackSession: jest.fn().mockImplementation(cb => (trackSessionCallback = cb)),\n handleIncomingRedirect: jest.fn(),\n login: jest.fn().mockImplementation(() => {\n trackSessionCallback({ isLoggedIn: true, webId: alice.webId });\n }),\n proposeUriForNewThing: jest.fn(),\n addNewThing: jest.fn().mockResolvedValue(void null),\n };\n when(os.store.get)\n .calledWith(alice.webId)\n .mockReturnValue({\n label: () => alice.name,\n picture: () => ({\n url: alice.picture,\n }),\n });\n (createPodOS as jest.Mock).mockReturnValue(os);\n return os;\n}\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { newSpecPage } from "@stencil/core/testing";
|
|
2
|
-
import { TestComponent } from "./TestComponent";
|
|
3
|
-
export function renderFunctionalComponent(jsx) {
|
|
4
|
-
return newSpecPage({
|
|
5
|
-
components: [TestComponent],
|
|
6
|
-
template: () => jsx,
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=renderFunctionalComponent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderFunctionalComponent.js","sourceRoot":"","sources":["../../../src/test/renderFunctionalComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,UAAU,yBAAyB,CAAC,GAAQ;EAChD,OAAO,WAAW,CAAC;IACjB,UAAU,EAAE,CAAC,aAAa,CAAC;IAC3B,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG;GACpB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { TestComponent } from './TestComponent';\n\nexport function renderFunctionalComponent(jsx: any) {\n return newSpecPage({\n components: [TestComponent],\n template: () => jsx,\n });\n}\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Components, JSX } from "../types/components";
|
|
2
|
-
|
|
3
|
-
interface TestComponent extends Components.TestComponent, HTMLElement {}
|
|
4
|
-
export const TestComponent: {
|
|
5
|
-
prototype: TestComponent;
|
|
6
|
-
new (): TestComponent;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Used to define this component and all nested components recursively.
|
|
10
|
-
*/
|
|
11
|
-
export const defineCustomElement: () => void;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement } from '@stencil/core/internal/client';
|
|
2
|
-
|
|
3
|
-
const TestComponent = /*@__PURE__*/ proxyCustomElement(class TestComponent extends HTMLElement {
|
|
4
|
-
static get is() { return "test-component"; }
|
|
5
|
-
}, [0, "test-component"]);
|
|
6
|
-
|
|
7
|
-
export { TestComponent };
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=test-component.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"test-component.js","mappings":";;MAGa,aAAa;;;;;;","names":[],"sources":["src/test/TestComponent.tsx"],"sourcesContent":["import { Component } from '@stencil/core';\n\n@Component({ tag: 'test-component' })\nexport class TestComponent {}\n"],"version":3}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["TestComponent"],"sources":["src/test/TestComponent.tsx"],"sourcesContent":["import { Component } from '@stencil/core';\n\n@Component({ tag: 'test-component' })\nexport class TestComponent {}\n"],"mappings":"0CAGaA,EAAa,M"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance } from './index-26d6954d.js';
|
|
2
|
-
|
|
3
|
-
const TestComponent = class {
|
|
4
|
-
constructor(hostRef) {
|
|
5
|
-
registerInstance(this, hostRef);
|
|
6
|
-
}
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export { TestComponent as test_component };
|
|
10
|
-
|
|
11
|
-
//# sourceMappingURL=test-component.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"test-component.entry.js","mappings":";;MAGa,aAAa;;;;;;;;","names":[],"sources":["src/test/TestComponent.tsx"],"sourcesContent":["import { Component } from '@stencil/core';\n\n@Component({ tag: 'test-component' })\nexport class TestComponent {}\n"],"version":3}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/// <reference types="jest" />
|
|
2
|
-
export declare function mockPodOS(): {
|
|
3
|
-
fetch: jest.Mock<any, any>;
|
|
4
|
-
fetchFile: jest.Mock<any, any>;
|
|
5
|
-
store: {
|
|
6
|
-
get: jest.Mock<any, any>;
|
|
7
|
-
};
|
|
8
|
-
trackSession: jest.Mock<any, any>;
|
|
9
|
-
handleIncomingRedirect: jest.Mock<any, any>;
|
|
10
|
-
login: jest.Mock<any, any>;
|
|
11
|
-
proposeUriForNewThing: jest.Mock<any, any>;
|
|
12
|
-
addNewThing: jest.Mock<any, any>;
|
|
13
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function renderFunctionalComponent(jsx: any): Promise<import("@stencil/core/testing").SpecPage>;
|