@operato/context 10.29.43 → 10.29.44

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@operato/context",
3
3
  "description": "Webcomponent context following open-wc recommendations",
4
4
  "author": "heartyoh",
5
- "version": "10.29.43",
5
+ "version": "10.29.44",
6
6
  "type": "module",
7
7
  "main": "dist/src/index.js",
8
8
  "module": "dist/src/index.js",
@@ -67,12 +67,12 @@
67
67
  },
68
68
  "dependencies": {
69
69
  "@material/web": "^2.0.0",
70
- "@operato/help": "^10.29.43",
71
- "@operato/input": "^10.29.43",
72
- "@operato/layout": "^10.29.43",
73
- "@operato/shell": "^10.29.43",
70
+ "@operato/help": "^10.29.44",
71
+ "@operato/input": "^10.29.44",
72
+ "@operato/layout": "^10.29.44",
73
+ "@operato/shell": "^10.29.44",
74
74
  "@operato/styles": "^10.29.30",
75
- "@operato/utils": "^10.29.43",
75
+ "@operato/utils": "^10.29.44",
76
76
  "lit": "^3.1.2",
77
77
  "lodash-es": "^4.17.21"
78
78
  },
@@ -108,5 +108,5 @@
108
108
  "prettier --write"
109
109
  ]
110
110
  },
111
- "gitHead": "ccc06fed313fcc20a076a1cf7bc586fdacaba594"
111
+ "gitHead": "112d3ac6ada895fc45c2010c2555d5fd88a0f8a5"
112
112
  }
@@ -0,0 +1,43 @@
1
+ import { expect, fixture } from '@open-wc/testing'
2
+ import { html } from 'lit'
3
+
4
+ import { store } from '@operato/shell'
5
+
6
+ import '../src/tools/ox-page-title-bar.js'
7
+ import '../src/tools/ox-title-bar.js'
8
+
9
+ /*
10
+ * The title bar's search keeps what the user is typing through a context update - a screen that redraws its context
11
+ * while the user types (integration analysis) wiped the text when the field was bound with `live()`, 2026-10-17.
12
+ * A list query that was refused draws the field anew with the committed term.
13
+ */
14
+
15
+ const search = (el: HTMLElement) => el.shadowRoot!.querySelector('ox-input-search') as HTMLElement & { value: string }
16
+
17
+ for (const tag of ['ox-page-title-bar', 'ox-title-bar']) {
18
+ describe(`${tag} search`, () => {
19
+ const mount = async () => {
20
+ store.dispatch({ type: 'UPDATE_CONTEXT', context: { title: 'list', search: { handler: () => {}, value: '' } } } as any)
21
+ const el = document.createElement(tag) as HTMLElement & { updateComplete: Promise<unknown> }
22
+ await fixture(html`${el}`)
23
+ await el.updateComplete
24
+ return el
25
+ }
26
+
27
+ it('keeps the text being typed when the context is drawn again', async () => {
28
+ const el = await mount()
29
+ search(el).value = 'typing'
30
+ store.dispatch({ type: 'UPDATE_CONTEXT', context: { title: 'list', search: { handler: () => {}, value: '' } } } as any)
31
+ await el.updateComplete
32
+ expect(search(el).value).to.equal('typing')
33
+ })
34
+
35
+ it('shows the committed term again after a refused query', async () => {
36
+ const el = await mount()
37
+ search(el).value = 'refused'
38
+ document.dispatchEvent(new CustomEvent('query-refused'))
39
+ await el.updateComplete
40
+ expect(search(el).value).to.equal('')
41
+ })
42
+ })
43
+ }