@furystack/shades 8.0.10 → 8.0.12
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/esm/component-factory.spec.d.ts +2 -0
- package/esm/component-factory.spec.d.ts.map +1 -0
- package/esm/component-factory.spec.js +80 -0
- package/esm/component-factory.spec.js.map +1 -0
- package/esm/components/lazy-load.spec.d.ts +2 -0
- package/esm/components/lazy-load.spec.d.ts.map +1 -0
- package/esm/components/lazy-load.spec.js +76 -0
- package/esm/components/lazy-load.spec.js.map +1 -0
- package/esm/components/route-link.spec.d.ts +2 -0
- package/esm/components/route-link.spec.d.ts.map +1 -0
- package/esm/components/route-link.spec.js +33 -0
- package/esm/components/route-link.spec.js.map +1 -0
- package/esm/components/router.spec.d.ts +2 -0
- package/esm/components/router.spec.d.ts.map +1 -0
- package/esm/components/router.spec.js +89 -0
- package/esm/components/router.spec.js.map +1 -0
- package/esm/services/location-service.js +21 -18
- package/esm/services/location-service.js.map +1 -1
- package/esm/services/location-service.spec.d.ts +2 -0
- package/esm/services/location-service.spec.d.ts.map +1 -0
- package/esm/services/location-service.spec.js +90 -0
- package/esm/services/location-service.spec.js.map +1 -0
- package/esm/services/resource-manager.js +21 -23
- package/esm/services/resource-manager.js.map +1 -1
- package/esm/services/resource-manager.spec.d.ts +2 -0
- package/esm/services/resource-manager.spec.d.ts.map +1 -0
- package/esm/services/resource-manager.spec.js +31 -0
- package/esm/services/resource-manager.spec.js.map +1 -0
- package/esm/services/screen-service.js +32 -31
- package/esm/services/screen-service.js.map +1 -1
- package/esm/services/screen-service.spec.d.ts +2 -0
- package/esm/services/screen-service.spec.d.ts.map +1 -0
- package/esm/services/screen-service.spec.js +28 -0
- package/esm/services/screen-service.spec.js.map +1 -0
- package/esm/shade-resources.integration.spec.d.ts +2 -0
- package/esm/shade-resources.integration.spec.d.ts.map +1 -0
- package/esm/shade-resources.integration.spec.js +58 -0
- package/esm/shade-resources.integration.spec.js.map +1 -0
- package/esm/shade.js +80 -74
- package/esm/shade.js.map +1 -1
- package/esm/shades.integration.spec.d.ts +2 -0
- package/esm/shades.integration.spec.d.ts.map +1 -0
- package/esm/shades.integration.spec.js +254 -0
- package/esm/shades.integration.spec.js.map +1 -0
- package/package.json +8 -8
- package/src/component-factory.spec.tsx +2 -2
- package/src/components/lazy-load.spec.tsx +4 -2
- package/src/components/route-link.spec.tsx +4 -2
- package/src/components/router.spec.tsx +5 -3
- package/src/services/location-service.spec.ts +1 -1
- package/src/services/resource-manager.spec.ts +1 -1
- package/src/services/screen-service.spec.ts +1 -1
- package/src/shade-resources.integration.spec.tsx +3 -3
- package/src/shades.integration.spec.tsx +3 -3
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { Injector } from '@furystack/inject';
|
|
2
|
+
import { usingAsync } from '@furystack/utils';
|
|
3
|
+
import { TextEncoder, TextDecoder } from 'util';
|
|
4
|
+
global.TextEncoder = TextEncoder;
|
|
5
|
+
global.TextDecoder = TextDecoder;
|
|
6
|
+
import { initializeShadeRoot } from './initialize.js';
|
|
7
|
+
import { Shade } from './shade.js';
|
|
8
|
+
import { createComponent } from './shade-component.js';
|
|
9
|
+
import { describe, it, expect, vi, afterEach, beforeEach } from 'vitest';
|
|
10
|
+
describe('Shades integration tests', () => {
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
document.body.innerHTML = '<div id="root"></div>';
|
|
13
|
+
});
|
|
14
|
+
afterEach(() => {
|
|
15
|
+
document.body.innerHTML = '';
|
|
16
|
+
});
|
|
17
|
+
it('Should mount a custom component to a Shade root', () => {
|
|
18
|
+
const injector = new Injector();
|
|
19
|
+
const rootElement = document.getElementById('root');
|
|
20
|
+
const ExampleComponent = Shade({ render: () => createComponent("div", null, "Hello"), shadowDomName: 'shades-example' });
|
|
21
|
+
initializeShadeRoot({
|
|
22
|
+
injector,
|
|
23
|
+
rootElement,
|
|
24
|
+
jsxElement: createComponent(ExampleComponent, null),
|
|
25
|
+
});
|
|
26
|
+
expect(document.body.innerHTML).toBe('<div id="root"><shades-example><div>Hello</div></shades-example></div>');
|
|
27
|
+
});
|
|
28
|
+
it('Should mount a custom component with a string render result', () => {
|
|
29
|
+
const injector = new Injector();
|
|
30
|
+
const rootElement = document.getElementById('root');
|
|
31
|
+
const ExampleComponent = Shade({ render: () => 'Hello', shadowDomName: 'shades-string-render-result' });
|
|
32
|
+
initializeShadeRoot({
|
|
33
|
+
injector,
|
|
34
|
+
rootElement,
|
|
35
|
+
jsxElement: createComponent(ExampleComponent, null),
|
|
36
|
+
});
|
|
37
|
+
expect(document.body.innerHTML).toBe('<div id="root"><shades-string-render-result>Hello</shades-string-render-result></div>');
|
|
38
|
+
});
|
|
39
|
+
it('Should mount a custom component with null render result', async () => {
|
|
40
|
+
await usingAsync(new Injector(), async (injector) => {
|
|
41
|
+
const rootElement = document.getElementById('root');
|
|
42
|
+
const ExampleComponent = Shade({ render: () => null, shadowDomName: 'shades-null-render-result' });
|
|
43
|
+
initializeShadeRoot({
|
|
44
|
+
injector,
|
|
45
|
+
rootElement,
|
|
46
|
+
jsxElement: createComponent(ExampleComponent, null),
|
|
47
|
+
});
|
|
48
|
+
expect(document.body.innerHTML).toBe('<div id="root"><shades-null-render-result></shades-null-render-result></div>');
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
it('Should mount a custom component with a document fragment render result', async () => {
|
|
52
|
+
await usingAsync(new Injector(), async (injector) => {
|
|
53
|
+
const rootElement = document.getElementById('root');
|
|
54
|
+
const ExampleComponent = Shade({
|
|
55
|
+
render: () => (createComponent(createComponent, null,
|
|
56
|
+
createComponent("p", null, "1"),
|
|
57
|
+
createComponent("p", null, "2"))),
|
|
58
|
+
shadowDomName: 'shades-fragment-render-result',
|
|
59
|
+
});
|
|
60
|
+
initializeShadeRoot({
|
|
61
|
+
injector,
|
|
62
|
+
rootElement,
|
|
63
|
+
jsxElement: createComponent(ExampleComponent, null),
|
|
64
|
+
});
|
|
65
|
+
expect(document.body.innerHTML).toBe('<div id="root"><shades-fragment-render-result><p>1</p><p>2</p></shades-fragment-render-result></div>');
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
it('Should mount a custom component with a nested document fragment render result', async () => {
|
|
69
|
+
await usingAsync(new Injector(), async (injector) => {
|
|
70
|
+
const rootElement = document.getElementById('root');
|
|
71
|
+
const ExampleComponent = Shade({
|
|
72
|
+
render: () => (createComponent("p", null,
|
|
73
|
+
createComponent(createComponent, null,
|
|
74
|
+
createComponent("p", null, "1"),
|
|
75
|
+
createComponent("p", null, "2")))),
|
|
76
|
+
shadowDomName: 'shades-fragment-render-result-nested',
|
|
77
|
+
});
|
|
78
|
+
initializeShadeRoot({
|
|
79
|
+
injector,
|
|
80
|
+
rootElement,
|
|
81
|
+
jsxElement: createComponent(ExampleComponent, null),
|
|
82
|
+
});
|
|
83
|
+
expect(document.body.innerHTML).toBe('<div id="root"><shades-fragment-render-result-nested><p><p>1</p><p>2</p></p></shades-fragment-render-result-nested></div>');
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
it('Should mount a custom component with a document fragment that contains custom components', async () => {
|
|
87
|
+
await usingAsync(new Injector(), async (injector) => {
|
|
88
|
+
const rootElement = document.getElementById('root');
|
|
89
|
+
const CustomComponent = Shade({
|
|
90
|
+
shadowDomName: 'shades-fragment-test-custom-component',
|
|
91
|
+
render: () => createComponent("p", null, "Hello"),
|
|
92
|
+
});
|
|
93
|
+
const ExampleComponent = Shade({
|
|
94
|
+
render: () => (createComponent(createComponent, null,
|
|
95
|
+
createComponent(CustomComponent, null),
|
|
96
|
+
createComponent(CustomComponent, null))),
|
|
97
|
+
shadowDomName: 'shades-fragment-render-result-2',
|
|
98
|
+
});
|
|
99
|
+
initializeShadeRoot({
|
|
100
|
+
injector,
|
|
101
|
+
rootElement,
|
|
102
|
+
jsxElement: createComponent(ExampleComponent, null),
|
|
103
|
+
});
|
|
104
|
+
expect(document.body.innerHTML).toBe('<div id="root"><shades-fragment-render-result-2><shades-fragment-test-custom-component><p>Hello</p></shades-fragment-test-custom-component><shades-fragment-test-custom-component><p>Hello</p></shades-fragment-test-custom-component></shades-fragment-render-result-2></div>');
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
it('Should mount nested Shades components', async () => {
|
|
108
|
+
await usingAsync(new Injector(), async (injector) => {
|
|
109
|
+
const rootElement = document.getElementById('root');
|
|
110
|
+
const ExampleComponent = Shade({
|
|
111
|
+
render: ({ children }) => createComponent("div", null, children),
|
|
112
|
+
shadowDomName: 'shades-example-2',
|
|
113
|
+
});
|
|
114
|
+
const ExampleSubs = Shade({
|
|
115
|
+
render: ({ props }) => createComponent("div", null, props.no),
|
|
116
|
+
shadowDomName: 'shades-example-sub',
|
|
117
|
+
});
|
|
118
|
+
initializeShadeRoot({
|
|
119
|
+
injector,
|
|
120
|
+
rootElement,
|
|
121
|
+
jsxElement: (createComponent(ExampleComponent, null,
|
|
122
|
+
createComponent(ExampleSubs, { no: 1 }),
|
|
123
|
+
createComponent(ExampleSubs, { no: 2 }),
|
|
124
|
+
createComponent(ExampleSubs, { no: 3 }))),
|
|
125
|
+
});
|
|
126
|
+
expect(document.body.innerHTML).toBe('<div id="root"><shades-example-2><div><shades-example-sub><div>1</div></shades-example-sub><shades-example-sub><div>2</div></shades-example-sub><shades-example-sub><div>3</div></shades-example-sub></div></shades-example-2></div>');
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
it("Should execute the constructed and constructed's cleanup callback", async () => {
|
|
130
|
+
await usingAsync(new Injector(), async (injector) => {
|
|
131
|
+
const rootElement = document.getElementById('root');
|
|
132
|
+
const cleanup = vi.fn();
|
|
133
|
+
const constructed = vi.fn(() => cleanup);
|
|
134
|
+
const ExampleComponent = Shade({
|
|
135
|
+
constructed,
|
|
136
|
+
shadowDomName: 'example-component-1',
|
|
137
|
+
render: () => createComponent("div", null, "Hello"),
|
|
138
|
+
});
|
|
139
|
+
initializeShadeRoot({
|
|
140
|
+
injector,
|
|
141
|
+
rootElement,
|
|
142
|
+
jsxElement: createComponent(ExampleComponent, null),
|
|
143
|
+
});
|
|
144
|
+
expect(constructed).toBeCalled();
|
|
145
|
+
expect(cleanup).not.toBeCalled();
|
|
146
|
+
document.body.innerHTML = '';
|
|
147
|
+
expect(cleanup).toBeCalled();
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
it('Should execute the onAttach and onDetach callbacks', async () => {
|
|
151
|
+
await usingAsync(new Injector(), async (injector) => {
|
|
152
|
+
const rootElement = document.getElementById('root');
|
|
153
|
+
const onAttach = vi.fn();
|
|
154
|
+
const onDetach = vi.fn();
|
|
155
|
+
const ExampleComponent = Shade({
|
|
156
|
+
onAttach,
|
|
157
|
+
onDetach,
|
|
158
|
+
shadowDomName: 'example-component-2',
|
|
159
|
+
render: () => createComponent("div", null, "Hello"),
|
|
160
|
+
});
|
|
161
|
+
initializeShadeRoot({
|
|
162
|
+
injector,
|
|
163
|
+
rootElement,
|
|
164
|
+
jsxElement: createComponent(ExampleComponent, null),
|
|
165
|
+
});
|
|
166
|
+
expect(onAttach).toBeCalled();
|
|
167
|
+
expect(onDetach).not.toBeCalled();
|
|
168
|
+
document.body.innerHTML = '';
|
|
169
|
+
expect(onDetach).toBeCalled();
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
it('Should update state', async () => {
|
|
173
|
+
await usingAsync(new Injector(), async (injector) => {
|
|
174
|
+
const rootElement = document.getElementById('root');
|
|
175
|
+
const ExampleComponent = Shade({
|
|
176
|
+
shadowDomName: 'example-component-3',
|
|
177
|
+
render: ({ useState }) => {
|
|
178
|
+
const [count, setCount] = useState('count', 0);
|
|
179
|
+
return (createComponent("div", null,
|
|
180
|
+
"Count is ",
|
|
181
|
+
count,
|
|
182
|
+
createComponent("button", { id: "plus", onclick: () => setCount(count + 1) }, "+"),
|
|
183
|
+
createComponent("button", { id: "minus", onclick: () => setCount(count - 1) }, "-")));
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
initializeShadeRoot({
|
|
187
|
+
injector,
|
|
188
|
+
rootElement,
|
|
189
|
+
jsxElement: createComponent(ExampleComponent, null),
|
|
190
|
+
});
|
|
191
|
+
const plus = () => document.getElementById('plus')?.click();
|
|
192
|
+
const minus = () => document.getElementById('minus')?.click();
|
|
193
|
+
const expectCount = (count) => expect(document.body.innerHTML).toContain(`Count is ${count}`);
|
|
194
|
+
expectCount(0);
|
|
195
|
+
plus();
|
|
196
|
+
expectCount(1);
|
|
197
|
+
plus();
|
|
198
|
+
expectCount(2);
|
|
199
|
+
minus();
|
|
200
|
+
minus();
|
|
201
|
+
expectCount(0);
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
it('Should allow children update after unmount and remount', async () => {
|
|
205
|
+
await usingAsync(new Injector(), async (injector) => {
|
|
206
|
+
const rootElement = document.getElementById('root');
|
|
207
|
+
const Parent = Shade({
|
|
208
|
+
shadowDomName: 'shade-remount-parent',
|
|
209
|
+
render: ({ children, useState }) => {
|
|
210
|
+
const [areChildrenVisible, setAreChildrenVisible] = useState('areChildrenVisible', true);
|
|
211
|
+
return (createComponent("div", null,
|
|
212
|
+
createComponent("button", { id: "showHideChildren", onclick: () => {
|
|
213
|
+
setAreChildrenVisible(!areChildrenVisible);
|
|
214
|
+
} }, "Toggle"),
|
|
215
|
+
areChildrenVisible ? children : null));
|
|
216
|
+
},
|
|
217
|
+
});
|
|
218
|
+
const Child = Shade({
|
|
219
|
+
shadowDomName: 'example-remount-child',
|
|
220
|
+
render: ({ useState }) => {
|
|
221
|
+
const [count, setCount] = useState('count', 0);
|
|
222
|
+
return (createComponent("div", null,
|
|
223
|
+
"Count is ",
|
|
224
|
+
`${count}`,
|
|
225
|
+
createComponent("button", { id: "plus", onclick: () => setCount(count + 1) }, "+"),
|
|
226
|
+
createComponent("button", { id: "minus", onclick: () => setCount(count - 1) }, "-")));
|
|
227
|
+
},
|
|
228
|
+
});
|
|
229
|
+
initializeShadeRoot({
|
|
230
|
+
injector,
|
|
231
|
+
rootElement,
|
|
232
|
+
jsxElement: (createComponent(Parent, null,
|
|
233
|
+
createComponent(Child, null))),
|
|
234
|
+
});
|
|
235
|
+
const plus = () => document.getElementById('plus')?.click();
|
|
236
|
+
const minus = () => document.getElementById('minus')?.click();
|
|
237
|
+
const expectCount = (count) => expect(document.body.innerHTML).toContain(`Count is ${count}`);
|
|
238
|
+
const toggleChildren = () => document.getElementById('showHideChildren')?.click();
|
|
239
|
+
expectCount(0);
|
|
240
|
+
plus();
|
|
241
|
+
expectCount(1);
|
|
242
|
+
toggleChildren();
|
|
243
|
+
expect(document.getElementById('plus')).toBeNull();
|
|
244
|
+
toggleChildren();
|
|
245
|
+
expect(document.getElementById('plus')).toBeDefined();
|
|
246
|
+
expectCount(0);
|
|
247
|
+
plus();
|
|
248
|
+
expectCount(1);
|
|
249
|
+
minus();
|
|
250
|
+
expectCount(0);
|
|
251
|
+
});
|
|
252
|
+
});
|
|
253
|
+
});
|
|
254
|
+
//# sourceMappingURL=shades.integration.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shades.integration.spec.js","sourceRoot":"","sources":["../src/shades.integration.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AAE/C,MAAM,CAAC,WAAW,GAAG,WAAW,CAAA;AAChC,MAAM,CAAC,WAAW,GAAG,WAAkB,CAAA;AAEvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,QAAQ,CAA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;YACd,IAAI,EAAE,CAAA;YACN,WAAW,CAAC,CAAC,CAAC,CAAA;YAEd,cAAc,EAAE,CAAA;YAEhB,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAA;YAElD,cAAc,EAAE,CAAA;YAChB,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,EAAE,CAAA;YAErD,WAAW,CAAC,CAAC,CAAC,CAAA;YACd,IAAI,EAAE,CAAA;YACN,WAAW,CAAC,CAAC,CAAC,CAAA;YACd,KAAK,EAAE,CAAA;YACP,WAAW,CAAC,CAAC,CAAC,CAAA;QAChB,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@furystack/shades",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.12",
|
|
4
4
|
"description": "Google Authentication Provider for FuryStack",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -37,16 +37,16 @@
|
|
|
37
37
|
},
|
|
38
38
|
"homepage": "https://github.com/furystack/furystack",
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@types/jsdom": "^21.1.
|
|
41
|
-
"@types/node": "^20.
|
|
40
|
+
"@types/jsdom": "^21.1.4",
|
|
41
|
+
"@types/node": "^20.8.10",
|
|
42
42
|
"jsdom": "^22.1.0",
|
|
43
|
-
"typescript": "^5.
|
|
44
|
-
"vitest": "^0.34.
|
|
43
|
+
"typescript": "^5.2.2",
|
|
44
|
+
"vitest": "^0.34.6"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@furystack/inject": "^8.
|
|
48
|
-
"@furystack/rest": "^5.0.
|
|
49
|
-
"@furystack/utils": "^4.0.
|
|
47
|
+
"@furystack/inject": "^8.1.1",
|
|
48
|
+
"@furystack/rest": "^5.0.12",
|
|
49
|
+
"@furystack/utils": "^4.0.10",
|
|
50
50
|
"path-to-regexp": "^6.2.1",
|
|
51
51
|
"semaphore-async-await": "^1.5.1"
|
|
52
52
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createComponent } from './shade-component'
|
|
1
|
+
import { createComponent } from './shade-component.js'
|
|
2
2
|
import './jsx'
|
|
3
|
-
import { Shade } from './shade'
|
|
3
|
+
import { Shade } from './shade.js'
|
|
4
4
|
import { Injector } from '@furystack/inject'
|
|
5
5
|
import { describe, it, expect, vi } from 'vitest'
|
|
6
6
|
|
|
@@ -5,9 +5,11 @@ global.TextDecoder = TextDecoder as any
|
|
|
5
5
|
|
|
6
6
|
import { Injector } from '@furystack/inject'
|
|
7
7
|
import { sleepAsync } from '@furystack/utils'
|
|
8
|
-
import { LazyLoad } from './lazy-load'
|
|
9
|
-
|
|
8
|
+
import { LazyLoad } from './lazy-load.js'
|
|
9
|
+
|
|
10
10
|
import { describe, it, expect, vi, afterEach, beforeEach } from 'vitest'
|
|
11
|
+
import { initializeShadeRoot } from '../initialize.js'
|
|
12
|
+
import { createComponent } from '../shade-component.js'
|
|
11
13
|
|
|
12
14
|
describe('Lazy Load', () => {
|
|
13
15
|
beforeEach(() => {
|
|
@@ -4,9 +4,11 @@ global.TextEncoder = TextEncoder
|
|
|
4
4
|
global.TextDecoder = TextDecoder as any
|
|
5
5
|
|
|
6
6
|
import { Injector } from '@furystack/inject'
|
|
7
|
-
import { RouteLink } from './route-link'
|
|
8
|
-
import { createComponent, initializeShadeRoot, LocationService } from '..'
|
|
7
|
+
import { RouteLink } from './route-link.js'
|
|
9
8
|
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'
|
|
9
|
+
import { LocationService } from '../services/location-service.js'
|
|
10
|
+
import { initializeShadeRoot } from '../initialize.js'
|
|
11
|
+
import { createComponent } from '../shade-component.js'
|
|
10
12
|
|
|
11
13
|
describe('RouteLink', () => {
|
|
12
14
|
beforeEach(() => {
|
|
@@ -4,11 +4,13 @@ global.TextEncoder = TextEncoder
|
|
|
4
4
|
global.TextDecoder = TextDecoder as any
|
|
5
5
|
|
|
6
6
|
import { Injector } from '@furystack/inject'
|
|
7
|
-
import { Router } from './router'
|
|
8
|
-
import {
|
|
9
|
-
import { RouteLink } from '.'
|
|
7
|
+
import { Router } from './router.js'
|
|
8
|
+
import { RouteLink } from './route-link.js'
|
|
10
9
|
import { sleepAsync } from '@furystack/utils'
|
|
11
10
|
import { describe, it, expect, vi, afterEach, beforeEach } from 'vitest'
|
|
11
|
+
import { LocationService } from '../services/location-service.js'
|
|
12
|
+
import { initializeShadeRoot } from '../initialize.js'
|
|
13
|
+
import { createComponent } from '../shade-component.js'
|
|
12
14
|
|
|
13
15
|
describe('Router', () => {
|
|
14
16
|
beforeEach(() => {
|
|
@@ -6,7 +6,7 @@ global.TextDecoder = TextDecoder as any
|
|
|
6
6
|
import { Injector } from '@furystack/inject'
|
|
7
7
|
import { using } from '@furystack/utils'
|
|
8
8
|
import { serializeValue } from '@furystack/rest'
|
|
9
|
-
import { LocationService } from './'
|
|
9
|
+
import { LocationService } from './location-service.js'
|
|
10
10
|
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'
|
|
11
11
|
|
|
12
12
|
describe('LocationService', () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ObservableValue, using } from '@furystack/utils'
|
|
2
|
-
import { ResourceManager } from './resource-manager'
|
|
2
|
+
import { ResourceManager } from './resource-manager.js'
|
|
3
3
|
import { describe, it, expect } from 'vitest'
|
|
4
4
|
describe('ResourceManager', () => {
|
|
5
5
|
it('Should return an observable from cache', () => {
|
|
@@ -5,7 +5,7 @@ global.TextDecoder = TextDecoder as any
|
|
|
5
5
|
|
|
6
6
|
import { Injector } from '@furystack/inject'
|
|
7
7
|
import { usingAsync } from '@furystack/utils'
|
|
8
|
-
import { ScreenService } from './screen-service'
|
|
8
|
+
import { ScreenService } from './screen-service.js'
|
|
9
9
|
import { describe, it, expect, beforeEach, afterEach } from 'vitest'
|
|
10
10
|
|
|
11
11
|
describe('ScreenService', () => {
|
|
@@ -5,9 +5,9 @@ import { TextEncoder, TextDecoder } from 'util'
|
|
|
5
5
|
global.TextEncoder = TextEncoder
|
|
6
6
|
global.TextDecoder = TextDecoder as any
|
|
7
7
|
|
|
8
|
-
import { initializeShadeRoot } from './initialize'
|
|
9
|
-
import { Shade } from './shade'
|
|
10
|
-
import { createComponent } from './shade-component'
|
|
8
|
+
import { initializeShadeRoot } from './initialize.js'
|
|
9
|
+
import { Shade } from './shade.js'
|
|
10
|
+
import { createComponent } from './shade-component.js'
|
|
11
11
|
import { ObservableValue } from '@furystack/utils'
|
|
12
12
|
import { describe, it, expect, afterEach, beforeEach, vi } from 'vitest'
|
|
13
13
|
|
|
@@ -6,9 +6,9 @@ import { TextEncoder, TextDecoder } from 'util'
|
|
|
6
6
|
global.TextEncoder = TextEncoder
|
|
7
7
|
global.TextDecoder = TextDecoder as any
|
|
8
8
|
|
|
9
|
-
import { initializeShadeRoot } from './initialize'
|
|
10
|
-
import { Shade } from './shade'
|
|
11
|
-
import { createComponent } from './shade-component'
|
|
9
|
+
import { initializeShadeRoot } from './initialize.js'
|
|
10
|
+
import { Shade } from './shade.js'
|
|
11
|
+
import { createComponent } from './shade-component.js'
|
|
12
12
|
import { describe, it, expect, vi, afterEach, beforeEach } from 'vitest'
|
|
13
13
|
|
|
14
14
|
describe('Shades integration tests', () => {
|