@operato/help 10.29.31 → 10.29.33
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 +18 -0
- package/coverage/lcov-report/index.html +133 -28
- package/coverage/lcov.info +19627 -584
- package/dist/src/components/ox-help-spot.js +9 -2
- package/dist/src/components/ox-help-spot.js.map +1 -1
- package/dist/test/ox-doc.test.js +25 -0
- package/dist/test/ox-doc.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/test/ox-doc.test.ts +31 -0
- package/translations/en.json +4 -0
- package/translations/es.json +4 -0
- package/translations/ja.json +4 -0
- package/translations/ko.json +4 -0
- package/translations/ms.json +4 -0
- package/translations/zh.json +4 -0
package/test/ox-doc.test.ts
CHANGED
|
@@ -79,6 +79,21 @@ describe('ox-doc', () => {
|
|
|
79
79
|
})
|
|
80
80
|
|
|
81
81
|
describe('ox-help-spot', () => {
|
|
82
|
+
/* Its two links are words of the reader's language, not English left in a Korean screen. */
|
|
83
|
+
it('names its links in the reader\'s language', async () => {
|
|
84
|
+
const { i18next } = await import('@operato/i18n')
|
|
85
|
+
i18next.addResourceBundle(i18next.language || 'en', 'translations', { 'button.close': '닫기', 'text.help-open-full': '전체 보기' }, true, true)
|
|
86
|
+
const el = await fixture<HTMLElement>(html`<ox-help-spot topic="a/one" section="part"></ox-help-spot>`)
|
|
87
|
+
await waitUntil(() => el.shadowRoot!.querySelector('button.q'))
|
|
88
|
+
;(el.shadowRoot!.querySelector('button.q') as HTMLButtonElement).click()
|
|
89
|
+
await waitUntil(() => el.shadowRoot!.querySelector('.bar'))
|
|
90
|
+
|
|
91
|
+
const bar = el.shadowRoot!.querySelector('.bar')!.textContent!.replace(/\s+/g, ' ')
|
|
92
|
+
expect(bar).to.contain('전체 보기')
|
|
93
|
+
expect(bar).to.contain('닫기')
|
|
94
|
+
expect(bar).not.to.contain('close')
|
|
95
|
+
})
|
|
96
|
+
|
|
82
97
|
it('opens the section in place and closes on Escape', async () => {
|
|
83
98
|
const el = await fixture<HTMLElement>(html`<ox-help-spot topic="a/one" section="part"></ox-help-spot>`)
|
|
84
99
|
await waitUntil(() => el.shadowRoot!.querySelector('button.q'))
|
|
@@ -98,6 +113,22 @@ describe('ox-help-spot', () => {
|
|
|
98
113
|
await waitUntil(() => !el.shadowRoot!.querySelector('.panel'))
|
|
99
114
|
})
|
|
100
115
|
|
|
116
|
+
/* A `?` in a grid header sits in nowrap, bold, right-aligned text; its panel is a document and must not take those. */
|
|
117
|
+
it('opens a panel that wraps and reads from the start, whatever the text around the ?', async () => {
|
|
118
|
+
const host = await fixture<HTMLElement>(
|
|
119
|
+
html`<div style="white-space: nowrap; text-align: right; font-weight: 700; width: 120px"><ox-help-spot topic="a/one" section="part"></ox-help-spot></div>`
|
|
120
|
+
)
|
|
121
|
+
const el = host.querySelector('ox-help-spot') as HTMLElement
|
|
122
|
+
await waitUntil(() => el.shadowRoot!.querySelector('button.q'))
|
|
123
|
+
;(el.shadowRoot!.querySelector('button.q') as HTMLButtonElement).click()
|
|
124
|
+
await waitUntil(() => el.shadowRoot!.querySelector('.panel'))
|
|
125
|
+
|
|
126
|
+
const panel = getComputedStyle(el.shadowRoot!.querySelector('.panel')!)
|
|
127
|
+
expect(panel.whiteSpace).to.equal('normal')
|
|
128
|
+
expect(panel.textAlign).to.equal('start')
|
|
129
|
+
expect(panel.fontWeight).to.equal('400')
|
|
130
|
+
})
|
|
131
|
+
|
|
101
132
|
/* A `?` is placed before its help is written; it must not open 「Content not found」 or the whole document. */
|
|
102
133
|
it('stays out of sight until its topic is written', async () => {
|
|
103
134
|
const el = await fixture<HTMLElement>(html`<ox-help-spot topic="a/none" section="part"></ox-help-spot>`)
|