@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.
@@ -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>`)
@@ -0,0 +1,4 @@
1
+ {
2
+ "button.close": "Close",
3
+ "text.help-open-full": "open full"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "button.close": "Cerrar",
3
+ "text.help-open-full": "abrir completo"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "button.close": "閉じる",
3
+ "text.help-open-full": "全体を開く"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "button.close": "닫기",
3
+ "text.help-open-full": "전체 보기"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "button.close": "Tutup",
3
+ "text.help-open-full": "buka penuh"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "button.close": "关闭",
3
+ "text.help-open-full": "打开全文"
4
+ }