@operato/help 10.29.29 → 10.29.31
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 +17 -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 +146 -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.info +1277 -0
- package/dist/src/components/ox-help-spot.d.ts +6 -2
- package/dist/src/components/ox-help-spot.js +62 -1
- package/dist/src/components/ox-help-spot.js.map +1 -1
- package/dist/test/ox-doc.test.js +18 -0
- package/dist/test/ox-doc.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/test/ox-doc.test.ts +22 -0
package/test/ox-doc.test.ts
CHANGED
|
@@ -81,6 +81,7 @@ describe('ox-doc', () => {
|
|
|
81
81
|
describe('ox-help-spot', () => {
|
|
82
82
|
it('opens the section in place and closes on Escape', async () => {
|
|
83
83
|
const el = await fixture<HTMLElement>(html`<ox-help-spot topic="a/one" section="part"></ox-help-spot>`)
|
|
84
|
+
await waitUntil(() => el.shadowRoot!.querySelector('button.q'))
|
|
84
85
|
;(el.shadowRoot!.querySelector('button.q') as HTMLButtonElement).click()
|
|
85
86
|
await waitUntil(() => el.shadowRoot!.querySelector('ox-doc'))
|
|
86
87
|
|
|
@@ -96,4 +97,25 @@ describe('ox-help-spot', () => {
|
|
|
96
97
|
el.shadowRoot!.querySelector('.panel')!.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true, composed: true }))
|
|
97
98
|
await waitUntil(() => !el.shadowRoot!.querySelector('.panel'))
|
|
98
99
|
})
|
|
100
|
+
|
|
101
|
+
/* A `?` is placed before its help is written; it must not open 「Content not found」 or the whole document. */
|
|
102
|
+
it('stays out of sight until its topic is written', async () => {
|
|
103
|
+
const el = await fixture<HTMLElement>(html`<ox-help-spot topic="a/none" section="part"></ox-help-spot>`)
|
|
104
|
+
await waitUntil(() => requests.some(url => url.startsWith('/helps/a/none.html')))
|
|
105
|
+
await new Promise(resolve => setTimeout(resolve, 20))
|
|
106
|
+
|
|
107
|
+
expect(!!el.shadowRoot!.querySelector('button.q')).to.equal(false)
|
|
108
|
+
expect(el.hasAttribute('hidden')).to.equal(true)
|
|
109
|
+
expect(getComputedStyle(el).display).to.equal('none')
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
it('stays out of sight while the named section is not written', async () => {
|
|
113
|
+
const shown = await fixture<HTMLElement>(html`<ox-help-spot topic="a/one" section="part"></ox-help-spot>`)
|
|
114
|
+
const missing = await fixture<HTMLElement>(html`<ox-help-spot topic="a/one" section="later"></ox-help-spot>`)
|
|
115
|
+
await waitUntil(() => shown.shadowRoot!.querySelector('button.q'))
|
|
116
|
+
await new Promise(resolve => setTimeout(resolve, 20))
|
|
117
|
+
|
|
118
|
+
expect(!!missing.shadowRoot!.querySelector('button.q')).to.equal(false)
|
|
119
|
+
expect(missing.hasAttribute('hidden')).to.equal(true)
|
|
120
|
+
})
|
|
99
121
|
})
|