@operato/shell 10.29.44 → 10.29.45
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/CHANGELOG.md +9 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +1076 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov-report/test/fixtures/guarded-define.ts.html +118 -0
- package/coverage/lcov-report/test/fixtures/index.html +161 -0
- package/coverage/lcov-report/test/fixtures/no-registration.ts.html +91 -0
- package/coverage/lcov-report/test/fixtures/registers.ts.html +118 -0
- package/coverage/lcov-report/test/fixtures/unguarded-define.ts.html +112 -0
- package/coverage/lcov.info +58613 -0
- package/dist/src/app/pages/page-view.d.ts +3 -0
- package/dist/src/app/pages/page-view.js +19 -1
- package/dist/src/app/pages/page-view.js.map +1 -1
- package/dist/test/route-claims.test.d.ts +1 -0
- package/dist/test/route-claims.test.js +45 -0
- package/dist/test/route-claims.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/test/route-claims.test.ts +46 -0
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@operato/shell",
|
|
3
3
|
"description": "WebApplication architecturing shell following open-wc recommendations",
|
|
4
4
|
"author": "heartyoh",
|
|
5
|
-
"version": "10.29.
|
|
5
|
+
"version": "10.29.45",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/src/index.js",
|
|
8
8
|
"module": "dist/src/index.js",
|
|
@@ -103,5 +103,5 @@
|
|
|
103
103
|
"prettier --write"
|
|
104
104
|
]
|
|
105
105
|
},
|
|
106
|
-
"gitHead": "
|
|
106
|
+
"gitHead": "665fe43472777812af4e7f6be3c64c33940b04ea"
|
|
107
107
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { expect, fixture } from '@open-wc/testing'
|
|
2
|
+
import { html } from 'lit'
|
|
3
|
+
import { addressController } from '@operato/utils/address.js'
|
|
4
|
+
|
|
5
|
+
import { PageView } from '../src/app/pages/page-view.js'
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* A page's route arguments are compared under the claims of today. A page opened by an address with `filters`
|
|
9
|
+
* stores them among its arguments, because its grid claims `filters` only after it is drawn; on the next route
|
|
10
|
+
* dispatch they are no longer an argument. That is no change of the page's arguments - a screen that reads its list
|
|
11
|
+
* again on one (the Office ledgers) dropped the edits it held when the user came back from another screen.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
class Counting extends PageView {
|
|
15
|
+
changed: any[] = []
|
|
16
|
+
async pageUpdated(changes: any) {
|
|
17
|
+
if (changes.params) this.changed.push(changes.params)
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
customElements.define('route-claims-page', Counting)
|
|
21
|
+
|
|
22
|
+
describe('route arguments and the regions claimed after a page opened', () => {
|
|
23
|
+
it('a key claimed by a list after the page opened is no argument change', async () => {
|
|
24
|
+
const path = `/route-claims-${Math.random().toString(36).slice(2)}`
|
|
25
|
+
history.replaceState({}, '', `${path}?filters=[1]&contract=one`)
|
|
26
|
+
const page = await fixture<Counting>(html`<route-claims-page></route-claims-page>`)
|
|
27
|
+
page.lifecycle = { active: true, params: { filters: '[1]', contract: 'one' } }
|
|
28
|
+
page.active = true
|
|
29
|
+
await page.updateComplete
|
|
30
|
+
await new Promise(resolve => setTimeout(resolve, 0))
|
|
31
|
+
page.changed = []
|
|
32
|
+
|
|
33
|
+
addressController().registerQuery(path)
|
|
34
|
+
page.lifecycle = { active: true, params: { contract: 'one' } }
|
|
35
|
+
page.requestUpdate()
|
|
36
|
+
await page.updateComplete
|
|
37
|
+
await new Promise(resolve => setTimeout(resolve, 0))
|
|
38
|
+
expect(page.changed).to.deep.equal([])
|
|
39
|
+
|
|
40
|
+
page.lifecycle = { active: true, params: { contract: 'two' } }
|
|
41
|
+
page.requestUpdate()
|
|
42
|
+
await page.updateComplete
|
|
43
|
+
await new Promise(resolve => setTimeout(resolve, 0))
|
|
44
|
+
expect(page.changed).to.deep.equal([{ contract: 'two' }])
|
|
45
|
+
})
|
|
46
|
+
})
|