@api-client/ui 0.5.39 → 0.5.40
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/build/tsconfig.tsbuildinfo +1 -0
- package/package.json +1 -1
- package/.aiexclude +0 -3
- package/.cursor/rules/html-and-css-best-practices.mdc +0 -63
- package/.cursor/rules/lit-best-practices.mdc +0 -89
- package/.editorconfig +0 -29
- package/.github/CONTRIBUTING.md +0 -24
- package/.github/instructions/html-and-css-best-practices.instructions.md +0 -70
- package/.github/instructions/lit-best-practices.instructions.md +0 -90
- package/.github/release.yml +0 -14
- package/.github/stale.yml +0 -23
- package/.github/workflows/auto-release.yml +0 -182
- package/.github/workflows/release.yml +0 -82
- package/.prettierrc.js +0 -14
- package/.vscode/settings.json +0 -18
- package/RELEASE.md +0 -163
- package/RELEASE_SETUP.md +0 -235
- package/build/src/demo/DemoPage.d.ts +0 -81
- package/build/src/demo/DemoPage.d.ts.map +0 -1
- package/build/src/demo/DemoPage.js +0 -175
- package/build/src/demo/DemoPage.js.map +0 -1
- package/build/src/demo/DemoStyles.d.ts +0 -3
- package/build/src/demo/DemoStyles.d.ts.map +0 -1
- package/build/src/demo/DemoStyles.js +0 -60
- package/build/src/demo/DemoStyles.js.map +0 -1
- package/build/test/elements/navigation/Navigation.test.d.ts +0 -3
- package/build/test/elements/navigation/Navigation.test.d.ts.map +0 -1
- package/build/test/elements/navigation/Navigation.test.js +0 -113
- package/build/test/elements/navigation/Navigation.test.js.map +0 -1
- package/commitlint.config.cjs +0 -2
- package/demo/elements/authorization/AuthPlugin.js +0 -57
- package/demo/elements/authorization/AuthProxy.js +0 -215
- package/demo/elements/authorization/api-key.html +0 -27
- package/demo/elements/authorization/api-key.ts +0 -44
- package/demo/elements/authorization/basic.html +0 -27
- package/demo/elements/authorization/basic.ts +0 -43
- package/demo/elements/authorization/bearer.html +0 -27
- package/demo/elements/authorization/bearer.ts +0 -43
- package/demo/elements/authorization/env.js +0 -8
- package/demo/elements/authorization/index.html +0 -44
- package/demo/elements/authorization/ntlm.html +0 -27
- package/demo/elements/authorization/ntlm.ts +0 -43
- package/demo/elements/authorization/oauth-authorize.html +0 -75
- package/demo/elements/authorization/oauth-authorize.ts +0 -40
- package/demo/elements/authorization/oauth-error.html +0 -18
- package/demo/elements/authorization/oauth-error.ts +0 -10
- package/demo/elements/authorization/oauth-popup.html +0 -36
- package/demo/elements/authorization/oauth2.html +0 -27
- package/demo/elements/authorization/oauth2.ts +0 -100
- package/demo/elements/authorization/oidc.html +0 -27
- package/demo/elements/authorization/oidc.ts +0 -139
- package/demo/elements/authorization/private.crt +0 -31
- package/demo/elements/authorization/private.csr +0 -28
- package/demo/elements/authorization/private.key +0 -51
- package/demo/elements/authorization/private.pem +0 -31
- package/demo/elements/authorization/redirect.html +0 -20
- package/demo/elements/authorization/ssl-commands.sh +0 -30
- package/demo/elements/authorization/ssl.conf +0 -24
- package/demo/elements/autocomplete/index.html +0 -64
- package/demo/elements/autocomplete/index.ts +0 -171
- package/demo/elements/code-editor/CodeEditorDemo.ts +0 -173
- package/demo/elements/code-editor/index.html +0 -19
- package/demo/elements/context-menu/DemoIcons.ts +0 -21
- package/demo/elements/context-menu/basic.html +0 -25
- package/demo/elements/context-menu/basic.ts +0 -119
- package/demo/elements/context-menu/custom-data.html +0 -25
- package/demo/elements/context-menu/custom-data.ts +0 -62
- package/demo/elements/context-menu/demo.css +0 -28
- package/demo/elements/context-menu/enabled-state.html +0 -25
- package/demo/elements/context-menu/enabled-state.ts +0 -73
- package/demo/elements/context-menu/icons.html +0 -25
- package/demo/elements/context-menu/icons.ts +0 -64
- package/demo/elements/context-menu/index.html +0 -43
- package/demo/elements/context-menu/nested.html +0 -25
- package/demo/elements/context-menu/nestedt.ts +0 -152
- package/demo/elements/context-menu/no-execute.html +0 -25
- package/demo/elements/context-menu/no-execute.ts +0 -134
- package/demo/elements/context-menu/radio-menu.html +0 -25
- package/demo/elements/context-menu/radio-menu.ts +0 -83
- package/demo/elements/context-menu/separators.html +0 -25
- package/demo/elements/context-menu/separators.ts +0 -172
- package/demo/elements/currency/index.html +0 -91
- package/demo/elements/currency/index.ts +0 -352
- package/demo/elements/environment/environment-editor.html +0 -20
- package/demo/elements/environment/environment-editor.ts +0 -49
- package/demo/elements/environment/index.html +0 -33
- package/demo/elements/environment/server-editor.html +0 -20
- package/demo/elements/environment/server-editor.ts +0 -67
- package/demo/elements/environment/variables-editor.html +0 -20
- package/demo/elements/environment/variables-editor.ts +0 -94
- package/demo/elements/har/har-viewer.html +0 -20
- package/demo/elements/har/har-viewer.ts +0 -76
- package/demo/elements/har/har1.har +0 -3044
- package/demo/elements/har/har2.json +0 -439
- package/demo/elements/har/index.html +0 -26
- package/demo/elements/highlight/example.md +0 -27
- package/demo/elements/highlight/index.html +0 -31
- package/demo/elements/highlight/marked-highlight.html +0 -132
- package/demo/elements/highlight/marked-highlight.ts +0 -22
- package/demo/elements/highlight/prism-highlight.html +0 -62
- package/demo/elements/highlight/prism-highlight.ts +0 -17
- package/demo/elements/http/body-editor.html +0 -17
- package/demo/elements/http/body-editor.ts +0 -115
- package/demo/elements/http/headers.html +0 -17
- package/demo/elements/http/headers.ts +0 -59
- package/demo/elements/http/http-assertions.html +0 -20
- package/demo/elements/http/http-assertions.ts +0 -89
- package/demo/elements/http/http-flows.html +0 -23
- package/demo/elements/http/http-flows.ts +0 -89
- package/demo/elements/http/index.html +0 -45
- package/demo/elements/http/request-editor.html +0 -26
- package/demo/elements/http/request-editor.ts +0 -197
- package/demo/elements/http/request-log.html +0 -16
- package/demo/elements/http/request-log.ts +0 -136
- package/demo/elements/http/url-editing.html +0 -17
- package/demo/elements/http/url-editing.ts +0 -112
- package/demo/elements/icons/index.html +0 -81
- package/demo/elements/icons/index.ts +0 -52
- package/demo/elements/index.html +0 -72
- package/demo/elements/mention-textarea/index.html +0 -19
- package/demo/elements/mention-textarea/index.ts +0 -205
- package/demo/elements/navigation/navigation-item.html +0 -49
- package/demo/elements/navigation/navigation-item.ts +0 -131
- package/demo/elements/navigation/navigation.html +0 -20
- package/demo/elements/navigation/navigation.ts +0 -45
- package/demo/elements/project/index.html +0 -29
- package/demo/elements/project/project-run-report.html +0 -20
- package/demo/elements/project/project-run-report.ts +0 -132
- package/demo/elements/project/request-editor.html +0 -23
- package/demo/elements/project/request-editor.ts +0 -232
- package/demo/elements/user/user-avatar.html +0 -17
- package/demo/elements/user/user-avatar.ts +0 -60
- package/demo/env.js +0 -4
- package/demo/index.html +0 -34
- package/demo/layout/index.html +0 -94
- package/demo/layout/index.ts +0 -190
- package/demo/md/DemoStyles.ts +0 -61
- package/demo/md/UiDemoPage.ts +0 -6
- package/demo/md/buttons/button.html +0 -121
- package/demo/md/buttons/button.ts +0 -246
- package/demo/md/buttons/group.html +0 -36
- package/demo/md/buttons/group.ts +0 -171
- package/demo/md/checkbox/index.html +0 -39
- package/demo/md/checkbox/index.ts +0 -220
- package/demo/md/chip/chip.html +0 -70
- package/demo/md/chip/chip.ts +0 -219
- package/demo/md/chip/pawel6c9a.jpg +0 -0
- package/demo/md/collapse/CustomDetail.ts +0 -89
- package/demo/md/collapse/collapse.html +0 -21
- package/demo/md/collapse/collapse.ts +0 -78
- package/demo/md/date-picker/date-picker.ts +0 -336
- package/demo/md/date-picker/index.html +0 -171
- package/demo/md/dialog/confirm-dialog.html +0 -49
- package/demo/md/dialog/confirm-dialog.ts +0 -121
- package/demo/md/dialog/dialog.html +0 -25
- package/demo/md/dialog/dialog.ts +0 -468
- package/demo/md/dropdown-list/index.html +0 -31
- package/demo/md/dropdown-list/index.ts +0 -158
- package/demo/md/icon-button/index.html +0 -122
- package/demo/md/icon-button/index.ts +0 -132
- package/demo/md/index.html +0 -73
- package/demo/md/inputs/input.html +0 -73
- package/demo/md/inputs/input.ts +0 -278
- package/demo/md/inputs/radio.html +0 -39
- package/demo/md/inputs/radio.ts +0 -156
- package/demo/md/inputs/switch.html +0 -45
- package/demo/md/inputs/switch.ts +0 -144
- package/demo/md/list/list.html +0 -65
- package/demo/md/list/list.ts +0 -204
- package/demo/md/listbox/listbox.html +0 -31
- package/demo/md/listbox/listbox.ts +0 -27
- package/demo/md/menu/index.html +0 -19
- package/demo/md/menu/index.ts +0 -514
- package/demo/md/notification/snack.html +0 -21
- package/demo/md/notification/snack.ts +0 -70
- package/demo/md/progress/progress.html +0 -46
- package/demo/md/progress/progress.ts +0 -161
- package/demo/md/segmented-button/index.html +0 -21
- package/demo/md/segmented-button/index.ts +0 -55
- package/demo/md/select/index.html +0 -16
- package/demo/md/select/index.ts +0 -217
- package/demo/md/tabs/tabs.html +0 -40
- package/demo/md/tabs/tabs.ts +0 -214
- package/demo/oauth-popup.html +0 -36
- package/demo/page.css +0 -8
- package/demo/resources/calendar-month.png +0 -0
- package/demo/resources/favorite.png +0 -0
- package/demo/resources/fingerprint.png +0 -0
- package/demo/resources/home-work.png +0 -0
- package/demo/resources/mood.png +0 -0
- package/demo/resources/print.png +0 -0
- package/demo/resources/stars.png +0 -0
- package/demo/resources/theaters.png +0 -0
- package/demo/tsconfig.json +0 -4
- package/eslint.config.js +0 -97
- package/scripts/copy-assets.js +0 -21
- package/scripts/release.js +0 -66
- package/src/demo/DemoPage.ts +0 -169
- package/src/demo/DemoStyles.ts +0 -60
- package/test/README.md +0 -375
- package/test/contextual-menu/ContextMenu.test.ts +0 -760
- package/test/contextual-menu/ContextMenuElement.test.ts +0 -569
- package/test/core/activity.spec.ts +0 -413
- package/test/core/activity_manager.spec.ts +0 -544
- package/test/core/application.spec.ts +0 -218
- package/test/core/fragment.spec.ts +0 -565
- package/test/core/fragment_manager.spec.ts +0 -404
- package/test/core/live_data.spec.ts +0 -558
- package/test/core/renderer.spec.ts +0 -113
- package/test/dom-assertions.test.ts +0 -182
- package/test/elements/MonacoSetup.ts +0 -65
- package/test/elements/authorization/basic-method.test.ts +0 -177
- package/test/elements/authorization/bearer-method.test.ts +0 -143
- package/test/elements/authorization/ntlm-method.test.ts +0 -219
- package/test/elements/authorization/oauth2-client-credentials-method.test.ts +0 -334
- package/test/elements/authorization/oauth2-code-method.test.ts +0 -320
- package/test/elements/authorization/oauth2-custom-grant-method.test.ts +0 -255
- package/test/elements/authorization/oauth2-device-code-method.test.ts +0 -371
- package/test/elements/authorization/oauth2-implicit-method.test.ts +0 -407
- package/test/elements/authorization/oauth2-jwt-method.test.ts +0 -217
- package/test/elements/authorization/oauth2-password-method.test.ts +0 -275
- package/test/elements/authorization/openid-method.test.ts +0 -591
- package/test/elements/autocomplete/autocomplete-input.spec.ts +0 -646
- package/test/elements/code-editor/code-editor.accessibility.test.ts +0 -298
- package/test/elements/code-editor/code-editor.test.ts +0 -574
- package/test/elements/currency/CurrencyPicker.accessibility.test.ts +0 -328
- package/test/elements/currency/CurrencyPicker.core.test.ts +0 -318
- package/test/elements/currency/CurrencyPicker.integration.test.ts +0 -482
- package/test/elements/currency/CurrencyPicker.test.ts +0 -486
- package/test/elements/data-table/DataTable.browser.test.ts +0 -649
- package/test/elements/har/HarUtils.test.ts +0 -45
- package/test/elements/har/HarViewerElement.test.ts +0 -687
- package/test/elements/har/test-data/har1.har +0 -3044
- package/test/elements/highlight/MarkedHighlightElement.test.ts +0 -452
- package/test/elements/highlight/PrismHighlightElement.test.ts +0 -79
- package/test/elements/highlight/PrismHighlighter.test.ts +0 -94
- package/test/elements/highlight/remoteSanitization.md +0 -1
- package/test/elements/highlight/test.md +0 -3
- package/test/elements/highlight/test1.md +0 -3
- package/test/elements/highlight/test2.md +0 -1
- package/test/elements/http/BodyFormdataEditorElement.test.ts +0 -482
- package/test/elements/http/BodyMultipartEditorElement.test.ts +0 -658
- package/test/elements/http/BodyRawEditorElement.test.ts +0 -90
- package/test/elements/http/CertificateAdd.test.ts +0 -457
- package/test/elements/http/HttpAssertions.test.ts +0 -994
- package/test/elements/http/HttpFlows.test.ts +0 -502
- package/test/elements/http/UrlEncodeUtils.test.ts +0 -202
- package/test/elements/layout/SplitItem.test.ts +0 -440
- package/test/elements/layout/SplitLayoutManager.test.ts +0 -1501
- package/test/elements/layout/SplitPanel.test.ts +0 -1109
- package/test/elements/mention-textarea/MentionTextArea.basic.test.ts +0 -114
- package/test/elements/mention-textarea/MentionTextArea.test.ts +0 -613
- package/test/elements/navigation/Navigation.test.ts +0 -120
- package/test/env.ts +0 -15
- package/test/events/EventTypes.test.ts +0 -363
- package/test/events/EventsTestHelpers.ts +0 -16
- package/test/helpers/TestUtils.ts +0 -243
- package/test/helpers/UiMock.ts +0 -185
- package/test/lib/Dom.test.ts +0 -231
- package/test/md/button/UiButton.test.ts +0 -347
- package/test/md/button/UiIconButton.test.ts +0 -155
- package/test/md/chip/UiChip.test.ts +0 -219
- package/test/md/collapse/UiCollapse.test.ts +0 -250
- package/test/md/collapse/flex-layout.test.ts +0 -105
- package/test/md/date-time/DateTime.test.ts +0 -348
- package/test/md/dialog/UiConfirmDialog.test.ts +0 -131
- package/test/md/dialog/UiDialog.test.ts +0 -759
- package/test/md/menu/Menu.test.ts +0 -855
- package/test/md/menu/MenuIntegration.test.ts +0 -426
- package/test/md/menu/MenuItem.test.ts +0 -652
- package/test/md/menu/SubMenu.test.ts +0 -410
- package/test/md/progress/UiCircularProgressElement.test.ts +0 -481
- package/test/md/progress/UiProgressElement.test.ts +0 -117
- package/test/md/progress/UiRangeElement.test.ts +0 -156
- package/test/md/select/Select.test.ts +0 -925
- package/test/plugins/takeScreenshotPlugin.js +0 -35
- package/test/setup.test.ts +0 -217
- package/test/setup.ts +0 -117
- package/test/tsconfig.json +0 -7
- package/web-dev-server.config.js +0 -21
- package/web-test-runner.config.js +0 -90
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { html, fixture, assert, oneEvent, aTimeout } from '@open-wc/testing'
|
|
2
|
-
import type Navigation from '../../../src/elements/navigation/internals/Navigation.js'
|
|
3
|
-
import '../../../src/elements/navigation/ui-navigation.js'
|
|
4
|
-
import '../../../src/elements/navigation/ui-navigation-item.js'
|
|
5
|
-
|
|
6
|
-
describe('Navigation', () => {
|
|
7
|
-
it('renders with slot content', async () => {
|
|
8
|
-
const el = await fixture<Navigation>(html`
|
|
9
|
-
<ui-navigation aria-label="Main navigation">
|
|
10
|
-
<ui-navigation-item selected aria-current="page">Home</ui-navigation-item>
|
|
11
|
-
<ui-navigation-item>Search</ui-navigation-item>
|
|
12
|
-
<ui-navigation-item>Files</ui-navigation-item>
|
|
13
|
-
</ui-navigation>
|
|
14
|
-
`)
|
|
15
|
-
const nav = el.shadowRoot!.querySelector('nav')
|
|
16
|
-
assert.ok(nav, 'nav element is rendered')
|
|
17
|
-
assert.equal(nav?.getAttribute('aria-label'), 'Main navigation')
|
|
18
|
-
const items = el._items
|
|
19
|
-
assert.equal(items.length, 3)
|
|
20
|
-
assert.isTrue(items[0].selected)
|
|
21
|
-
assert.equal(items[0].getAttribute('aria-current'), 'page')
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
it('sets correct tabindex for items', async () => {
|
|
25
|
-
const el = await fixture<Navigation>(html`
|
|
26
|
-
<ui-navigation>
|
|
27
|
-
<ui-navigation-item selected>Home</ui-navigation-item>
|
|
28
|
-
<ui-navigation-item>Search</ui-navigation-item>
|
|
29
|
-
</ui-navigation>
|
|
30
|
-
`)
|
|
31
|
-
const items = el._items
|
|
32
|
-
assert.equal(items[0].getAttribute('tabindex'), '0')
|
|
33
|
-
assert.equal(items[1].getAttribute('tabindex'), '-1')
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
it('selects item on click and fires select event', async () => {
|
|
37
|
-
const el = await fixture<Navigation>(html`
|
|
38
|
-
<ui-navigation>
|
|
39
|
-
<ui-navigation-item>Home</ui-navigation-item>
|
|
40
|
-
<ui-navigation-item>Search</ui-navigation-item>
|
|
41
|
-
</ui-navigation>
|
|
42
|
-
`)
|
|
43
|
-
const items = el._items
|
|
44
|
-
setTimeout(() => items[1].click())
|
|
45
|
-
const ev = await oneEvent(el, 'select')
|
|
46
|
-
assert.equal(ev.detail.item, items[1])
|
|
47
|
-
assert.isTrue(items[1].selected)
|
|
48
|
-
assert.equal(items[1].getAttribute('tabindex'), '0')
|
|
49
|
-
assert.isFalse(items[0].selected)
|
|
50
|
-
assert.equal(items[0].getAttribute('tabindex'), '-1')
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
it('handles keyboard navigation (vertical)', async () => {
|
|
54
|
-
const el = await fixture<Navigation>(html`
|
|
55
|
-
<ui-navigation>
|
|
56
|
-
<ui-navigation-item>Home</ui-navigation-item>
|
|
57
|
-
<ui-navigation-item>Search</ui-navigation-item>
|
|
58
|
-
<ui-navigation-item>Files</ui-navigation-item>
|
|
59
|
-
</ui-navigation>
|
|
60
|
-
`)
|
|
61
|
-
const items = el._items
|
|
62
|
-
items[0].focus()
|
|
63
|
-
// ArrowDown moves to next
|
|
64
|
-
items[0].dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowDown', bubbles: true }))
|
|
65
|
-
await aTimeout(0)
|
|
66
|
-
assert.dom.equal(document.activeElement, items[1])
|
|
67
|
-
// ArrowUp wraps to last
|
|
68
|
-
items[1].dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowUp', bubbles: true }))
|
|
69
|
-
await aTimeout(0)
|
|
70
|
-
assert.dom.equal(document.activeElement, items[0])
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
it('handles keyboard navigation (horizontal)', async () => {
|
|
74
|
-
const el = await fixture<Navigation>(html`
|
|
75
|
-
<ui-navigation orientation="horizontal">
|
|
76
|
-
<ui-navigation-item>Home</ui-navigation-item>
|
|
77
|
-
<ui-navigation-item>Search</ui-navigation-item>
|
|
78
|
-
</ui-navigation>
|
|
79
|
-
`)
|
|
80
|
-
const items = el._items
|
|
81
|
-
items[0].focus()
|
|
82
|
-
items[0].dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowRight', bubbles: true }))
|
|
83
|
-
await aTimeout(0)
|
|
84
|
-
assert.dom.equal(document.activeElement, items[1])
|
|
85
|
-
items[1].dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowLeft', bubbles: true }))
|
|
86
|
-
await aTimeout(0)
|
|
87
|
-
assert.dom.equal(document.activeElement, items[0])
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
it('skips disabled items in navigation', async () => {
|
|
91
|
-
const el = await fixture<Navigation>(html`
|
|
92
|
-
<ui-navigation>
|
|
93
|
-
<ui-navigation-item>Home</ui-navigation-item>
|
|
94
|
-
<ui-navigation-item disabled>Search</ui-navigation-item>
|
|
95
|
-
<ui-navigation-item>Files</ui-navigation-item>
|
|
96
|
-
</ui-navigation>
|
|
97
|
-
`)
|
|
98
|
-
const items = el._items
|
|
99
|
-
items[0].focus()
|
|
100
|
-
items[0].dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowDown', bubbles: true }))
|
|
101
|
-
await aTimeout(0)
|
|
102
|
-
// Should skip disabled and go to Files
|
|
103
|
-
assert.dom.equal(document.activeElement, items[2])
|
|
104
|
-
})
|
|
105
|
-
|
|
106
|
-
it('sets aria-current on selected item if current is set', async () => {
|
|
107
|
-
const el = await fixture<Navigation>(html`
|
|
108
|
-
<ui-navigation current="page">
|
|
109
|
-
<ui-navigation-item>Home</ui-navigation-item>
|
|
110
|
-
<ui-navigation-item>Search</ui-navigation-item>
|
|
111
|
-
</ui-navigation>
|
|
112
|
-
`)
|
|
113
|
-
const items = el._items
|
|
114
|
-
// Simulate user selection by clicking the item (public API)
|
|
115
|
-
items[1].click()
|
|
116
|
-
await aTimeout(0)
|
|
117
|
-
assert.equal(items[1].getAttribute('aria-current'), 'page')
|
|
118
|
-
assert.isFalse(items[0].hasAttribute('aria-current'))
|
|
119
|
-
})
|
|
120
|
-
})
|
package/test/env.ts
DELETED
|
@@ -1,363 +0,0 @@
|
|
|
1
|
-
import { assert } from '@open-wc/testing'
|
|
2
|
-
import { ensureUnique } from './EventsTestHelpers.js'
|
|
3
|
-
import { EventTypes } from '../../src/events/EventTypes.js'
|
|
4
|
-
|
|
5
|
-
describe('events', () => {
|
|
6
|
-
describe('EventTypes', () => {
|
|
7
|
-
describe('HttpClient', () => {
|
|
8
|
-
describe('Workspace', () => {
|
|
9
|
-
it('has the namespace', () => {
|
|
10
|
-
assert.typeOf(EventTypes.HttpClient.Workspace, 'object')
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
it('has the State namespace', () => {
|
|
14
|
-
assert.typeOf(EventTypes.HttpClient.Workspace.State, 'object')
|
|
15
|
-
})
|
|
16
|
-
;[
|
|
17
|
-
['read', 'httpclientwsread'],
|
|
18
|
-
['write', 'httpclientwswrite'],
|
|
19
|
-
['append', 'httpclientwsappend'],
|
|
20
|
-
['triggerWrite', 'httpclientwstriggerwrite'],
|
|
21
|
-
].forEach(([prop, value]) => {
|
|
22
|
-
it(`has ${prop} property`, () => {
|
|
23
|
-
const t = prop as keyof Omit<typeof EventTypes.HttpClient.Workspace, 'State'>
|
|
24
|
-
assert.equal(EventTypes.HttpClient.Workspace[t], value)
|
|
25
|
-
})
|
|
26
|
-
})
|
|
27
|
-
;[['write', 'httpclientwsstatewrite']].forEach(([prop, value]) => {
|
|
28
|
-
it(`has ${prop} property`, () => {
|
|
29
|
-
const t = prop as keyof typeof EventTypes.HttpClient.Workspace.State
|
|
30
|
-
assert.equal(EventTypes.HttpClient.Workspace.State[t], value)
|
|
31
|
-
})
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
it('has unique events', () => {
|
|
35
|
-
ensureUnique('EventTypes.HttpClient.Workspace', EventTypes.HttpClient.Workspace)
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
it('has unique events on the State namespace', () => {
|
|
39
|
-
ensureUnique('EventTypes.HttpClient.Workspace.State', EventTypes.HttpClient.Workspace.State)
|
|
40
|
-
})
|
|
41
|
-
})
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
describe('SchemaDesign', () => {
|
|
45
|
-
it('has the namespace', () => {
|
|
46
|
-
assert.typeOf(EventTypes.SchemaDesign, 'object')
|
|
47
|
-
})
|
|
48
|
-
;[['changed', 'schemadesignchange']].forEach(([prop, value]) => {
|
|
49
|
-
it(`has ${prop} property`, () => {
|
|
50
|
-
const t = prop as keyof Omit<typeof EventTypes.SchemaDesign, 'State'>
|
|
51
|
-
assert.equal(EventTypes.SchemaDesign[t], value)
|
|
52
|
-
})
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
it('has State namespace', () => {
|
|
56
|
-
assert.typeOf(EventTypes.SchemaDesign.State, 'object')
|
|
57
|
-
})
|
|
58
|
-
;[['nameChanged', 'schemadesignnamechange']].forEach(([prop, value]) => {
|
|
59
|
-
it(`has ${prop} property`, () => {
|
|
60
|
-
const t = prop as keyof typeof EventTypes.SchemaDesign.State
|
|
61
|
-
assert.equal(EventTypes.SchemaDesign.State[t], value)
|
|
62
|
-
})
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
it('has unique events', () => {
|
|
66
|
-
ensureUnique('EventTypes.SchemaDesign', EventTypes.SchemaDesign)
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
it('has unique events on the State namespace', () => {
|
|
70
|
-
ensureUnique('EventTypes.SchemaDesign.State', EventTypes.SchemaDesign.State)
|
|
71
|
-
})
|
|
72
|
-
})
|
|
73
|
-
|
|
74
|
-
describe('HttpProject', () => {
|
|
75
|
-
describe('namespace', () => {
|
|
76
|
-
it('has the namespace', () => {
|
|
77
|
-
assert.typeOf(EventTypes.HttpProject, 'object')
|
|
78
|
-
})
|
|
79
|
-
;[['changed', 'httpprojectchange']].forEach(([prop, value]) => {
|
|
80
|
-
it(`has ${prop} property`, () => {
|
|
81
|
-
const t = prop as keyof Omit<typeof EventTypes.SchemaDesign, 'State' | 'Ui'>
|
|
82
|
-
assert.equal(EventTypes.HttpProject[t], value)
|
|
83
|
-
})
|
|
84
|
-
})
|
|
85
|
-
|
|
86
|
-
it('has State namespace', () => {
|
|
87
|
-
assert.typeOf(EventTypes.HttpProject.State, 'object')
|
|
88
|
-
})
|
|
89
|
-
;[['nameChanged', 'httpprojectnamechange']].forEach(([prop, value]) => {
|
|
90
|
-
it(`has ${prop} property`, () => {
|
|
91
|
-
const t = prop as keyof typeof EventTypes.HttpProject.State
|
|
92
|
-
assert.equal(EventTypes.HttpProject.State[t], value)
|
|
93
|
-
})
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
it('has unique events', () => {
|
|
97
|
-
ensureUnique('EventTypes.HttpProject', EventTypes.HttpProject)
|
|
98
|
-
})
|
|
99
|
-
|
|
100
|
-
it('has unique events on the State namespace', () => {
|
|
101
|
-
ensureUnique('EventTypes.HttpProject.State', EventTypes.HttpProject.State)
|
|
102
|
-
})
|
|
103
|
-
})
|
|
104
|
-
|
|
105
|
-
describe('Ui namespace', () => {
|
|
106
|
-
it('has the namespace', () => {
|
|
107
|
-
assert.typeOf(EventTypes.HttpProject.Ui, 'object')
|
|
108
|
-
})
|
|
109
|
-
;[['delete', 'appdatauiprojectdelete']].forEach(([prop, value]) => {
|
|
110
|
-
it(`has ${prop} property`, () => {
|
|
111
|
-
const t = prop as keyof Omit<typeof EventTypes.HttpProject.Ui, 'HttpRequest'>
|
|
112
|
-
assert.equal(EventTypes.HttpProject.Ui[t], value)
|
|
113
|
-
})
|
|
114
|
-
})
|
|
115
|
-
|
|
116
|
-
it('has HttpRequest namespace', () => {
|
|
117
|
-
assert.typeOf(EventTypes.HttpProject.Ui.HttpRequest, 'object')
|
|
118
|
-
})
|
|
119
|
-
;[
|
|
120
|
-
['set', 'appdatauiprojectrequestset'],
|
|
121
|
-
['get', 'appdatauiprojectrequestget'],
|
|
122
|
-
['delete', 'appdatauiprojectrequestdelete'],
|
|
123
|
-
].forEach(([prop, value]) => {
|
|
124
|
-
it(`has ${prop} property`, () => {
|
|
125
|
-
const t = prop as keyof typeof EventTypes.HttpProject.Ui.HttpRequest
|
|
126
|
-
assert.equal(EventTypes.HttpProject.Ui.HttpRequest[t], value)
|
|
127
|
-
})
|
|
128
|
-
})
|
|
129
|
-
|
|
130
|
-
it('has unique events', () => {
|
|
131
|
-
ensureUnique('EventTypes.HttpProject.Ui', EventTypes.HttpProject.Ui)
|
|
132
|
-
})
|
|
133
|
-
|
|
134
|
-
it('has unique events on the State namespace', () => {
|
|
135
|
-
ensureUnique('EventTypes.HttpProject.Ui.HttpRequest', EventTypes.HttpProject.Ui.HttpRequest)
|
|
136
|
-
})
|
|
137
|
-
})
|
|
138
|
-
})
|
|
139
|
-
|
|
140
|
-
describe('Http', () => {
|
|
141
|
-
describe('Request namespace', () => {
|
|
142
|
-
it('has the namespace', () => {
|
|
143
|
-
assert.typeOf(EventTypes.Http.Request, 'object')
|
|
144
|
-
})
|
|
145
|
-
;[
|
|
146
|
-
['send', 'requestsend'],
|
|
147
|
-
['rename', 'requestrename'],
|
|
148
|
-
].forEach(([prop, value]) => {
|
|
149
|
-
it(`has ${prop} property`, () => {
|
|
150
|
-
const t = prop as keyof Omit<typeof EventTypes.Http.Request, 'State'>
|
|
151
|
-
assert.equal(EventTypes.Http.Request[t], value)
|
|
152
|
-
})
|
|
153
|
-
})
|
|
154
|
-
|
|
155
|
-
it('has State namespace', () => {
|
|
156
|
-
assert.typeOf(EventTypes.Http.Request.State, 'object')
|
|
157
|
-
})
|
|
158
|
-
;[
|
|
159
|
-
['urlChange', 'requeststateurlchange'],
|
|
160
|
-
['contentTypeChange', 'requeststatecontenttypechange'],
|
|
161
|
-
].forEach(([prop, value]) => {
|
|
162
|
-
it(`has ${prop} property`, () => {
|
|
163
|
-
const t = prop as keyof typeof EventTypes.Http.Request.State
|
|
164
|
-
assert.equal(EventTypes.Http.Request.State[t], value)
|
|
165
|
-
})
|
|
166
|
-
})
|
|
167
|
-
|
|
168
|
-
it('has unique events', () => {
|
|
169
|
-
ensureUnique('EventTypes.Http.Request', EventTypes.Http.Request)
|
|
170
|
-
})
|
|
171
|
-
|
|
172
|
-
it('has unique events on the State namespace', () => {
|
|
173
|
-
ensureUnique('EventTypes.Http.Request.State', EventTypes.Http.Request.State)
|
|
174
|
-
})
|
|
175
|
-
})
|
|
176
|
-
})
|
|
177
|
-
|
|
178
|
-
describe('Store', () => {
|
|
179
|
-
describe('Store namespace', () => {
|
|
180
|
-
it('has the namespace', () => {
|
|
181
|
-
assert.typeOf(EventTypes.Store, 'object')
|
|
182
|
-
})
|
|
183
|
-
;[
|
|
184
|
-
['info', 'storebackendinfo'],
|
|
185
|
-
['initEnvironment', 'configstoreinitenv'],
|
|
186
|
-
].forEach(([prop, value]) => {
|
|
187
|
-
it(`has ${prop} property`, () => {
|
|
188
|
-
const t = prop as keyof Omit<
|
|
189
|
-
typeof EventTypes.Store,
|
|
190
|
-
'Global' | 'Auth' | 'File' | 'User' | 'History' | 'ProjectRuns'
|
|
191
|
-
>
|
|
192
|
-
assert.equal(EventTypes.Store[t], value)
|
|
193
|
-
})
|
|
194
|
-
})
|
|
195
|
-
|
|
196
|
-
it('has unique events', () => {
|
|
197
|
-
ensureUnique('EventTypes.Store', EventTypes.Store)
|
|
198
|
-
})
|
|
199
|
-
})
|
|
200
|
-
|
|
201
|
-
describe('Global namespace', () => {
|
|
202
|
-
it('has the namespace', () => {
|
|
203
|
-
assert.typeOf(EventTypes.Store, 'object')
|
|
204
|
-
})
|
|
205
|
-
;[
|
|
206
|
-
['setEnv', 'storesetgloablenvironment'],
|
|
207
|
-
['getEnv', 'storegetgloablenvironment'],
|
|
208
|
-
].forEach(([prop, value]) => {
|
|
209
|
-
it(`has ${prop} property`, () => {
|
|
210
|
-
const t = prop as keyof typeof EventTypes.Store.Global
|
|
211
|
-
assert.equal(EventTypes.Store.Global[t], value)
|
|
212
|
-
})
|
|
213
|
-
})
|
|
214
|
-
|
|
215
|
-
it('has unique events', () => {
|
|
216
|
-
ensureUnique('EventTypes.Store.Global', EventTypes.Store.Global)
|
|
217
|
-
})
|
|
218
|
-
})
|
|
219
|
-
|
|
220
|
-
describe('Auth namespace', () => {
|
|
221
|
-
it('has the namespace', () => {
|
|
222
|
-
assert.typeOf(EventTypes.Store, 'object')
|
|
223
|
-
})
|
|
224
|
-
;[
|
|
225
|
-
['isAuthenticated', 'storeaisauthenticated'],
|
|
226
|
-
['authenticate', 'storeauthenticate'],
|
|
227
|
-
['getToken', 'storeauthgettoken'],
|
|
228
|
-
].forEach(([prop, value]) => {
|
|
229
|
-
it(`has ${prop} property`, () => {
|
|
230
|
-
const t = prop as keyof typeof EventTypes.Store.Auth
|
|
231
|
-
assert.equal(EventTypes.Store.Auth[t], value)
|
|
232
|
-
})
|
|
233
|
-
})
|
|
234
|
-
|
|
235
|
-
it('has unique events', () => {
|
|
236
|
-
ensureUnique('EventTypes.Store.Auth', EventTypes.Store.Auth)
|
|
237
|
-
})
|
|
238
|
-
})
|
|
239
|
-
|
|
240
|
-
describe('File namespace', () => {
|
|
241
|
-
it('has the namespace', () => {
|
|
242
|
-
assert.typeOf(EventTypes.Store, 'object')
|
|
243
|
-
})
|
|
244
|
-
;[
|
|
245
|
-
['list', 'storefileslist'],
|
|
246
|
-
['listShared', 'storefileslistshared'],
|
|
247
|
-
['create', 'storefilescreate'],
|
|
248
|
-
['createDefault', 'storefilescreatedefault'],
|
|
249
|
-
['read', 'storefilesread'],
|
|
250
|
-
['patch', 'storefilespatch'],
|
|
251
|
-
['delete', 'storefilesdelete'],
|
|
252
|
-
['patchUsers', 'storefilespatchusers'],
|
|
253
|
-
['listUsers', 'storefileslistusers'],
|
|
254
|
-
].forEach(([prop, value]) => {
|
|
255
|
-
it(`has ${prop} property`, () => {
|
|
256
|
-
const t = prop as keyof typeof EventTypes.Store.File
|
|
257
|
-
assert.equal(EventTypes.Store.File[t], value)
|
|
258
|
-
})
|
|
259
|
-
})
|
|
260
|
-
|
|
261
|
-
it('has unique events', () => {
|
|
262
|
-
ensureUnique('EventTypes.Store.File', EventTypes.Store.File)
|
|
263
|
-
})
|
|
264
|
-
})
|
|
265
|
-
|
|
266
|
-
describe('User namespace', () => {
|
|
267
|
-
it('has the namespace', () => {
|
|
268
|
-
assert.typeOf(EventTypes.Store, 'object')
|
|
269
|
-
})
|
|
270
|
-
;[
|
|
271
|
-
['me', 'storeuserme'],
|
|
272
|
-
['list', 'storeuserlist'],
|
|
273
|
-
['read', 'storeuserread'],
|
|
274
|
-
].forEach(([prop, value]) => {
|
|
275
|
-
it(`has ${prop} property`, () => {
|
|
276
|
-
const t = prop as keyof typeof EventTypes.Store.User
|
|
277
|
-
assert.equal(EventTypes.Store.User[t], value)
|
|
278
|
-
})
|
|
279
|
-
})
|
|
280
|
-
|
|
281
|
-
it('has unique events', () => {
|
|
282
|
-
ensureUnique('EventTypes.Store.User', EventTypes.Store.User)
|
|
283
|
-
})
|
|
284
|
-
})
|
|
285
|
-
|
|
286
|
-
describe('History namespace', () => {
|
|
287
|
-
it('has the namespace', () => {
|
|
288
|
-
assert.typeOf(EventTypes.Store, 'object')
|
|
289
|
-
})
|
|
290
|
-
;[
|
|
291
|
-
['create', 'storehistorycreate'],
|
|
292
|
-
['createBulk', 'storehistorycreatebulk'],
|
|
293
|
-
['list', 'storehistorylist'],
|
|
294
|
-
['delete', 'storehistorydelete'],
|
|
295
|
-
['read', 'storehistoryread'],
|
|
296
|
-
].forEach(([prop, value]) => {
|
|
297
|
-
it(`has ${prop} property`, () => {
|
|
298
|
-
const t = prop as keyof typeof EventTypes.Store.History
|
|
299
|
-
assert.equal(EventTypes.Store.History[t], value)
|
|
300
|
-
})
|
|
301
|
-
})
|
|
302
|
-
|
|
303
|
-
it('has unique events', () => {
|
|
304
|
-
ensureUnique('EventTypes.Store.History', EventTypes.Store.History)
|
|
305
|
-
})
|
|
306
|
-
})
|
|
307
|
-
})
|
|
308
|
-
|
|
309
|
-
describe('Config', () => {
|
|
310
|
-
describe('Session namespace', () => {
|
|
311
|
-
it('has the namespace', () => {
|
|
312
|
-
assert.typeOf(EventTypes.Config.Session, 'object')
|
|
313
|
-
})
|
|
314
|
-
|
|
315
|
-
it('has unique events', () => {
|
|
316
|
-
ensureUnique('EventTypes.Config.Session', EventTypes.Config.Session)
|
|
317
|
-
})
|
|
318
|
-
})
|
|
319
|
-
|
|
320
|
-
describe('Local namespace', () => {
|
|
321
|
-
it('has the namespace', () => {
|
|
322
|
-
assert.typeOf(EventTypes.Config.Local, 'object')
|
|
323
|
-
})
|
|
324
|
-
|
|
325
|
-
it('has unique events', () => {
|
|
326
|
-
ensureUnique('EventTypes.Config.Local', EventTypes.Config.Local)
|
|
327
|
-
})
|
|
328
|
-
})
|
|
329
|
-
|
|
330
|
-
describe('Telemetry namespace', () => {
|
|
331
|
-
it('has the namespace', () => {
|
|
332
|
-
assert.typeOf(EventTypes.Config.Telemetry, 'object')
|
|
333
|
-
})
|
|
334
|
-
|
|
335
|
-
it('has unique events', () => {
|
|
336
|
-
ensureUnique('EventTypes.Config.Telemetry', EventTypes.Config.Telemetry)
|
|
337
|
-
})
|
|
338
|
-
})
|
|
339
|
-
})
|
|
340
|
-
|
|
341
|
-
describe('Navigation', () => {
|
|
342
|
-
describe('App namespace', () => {
|
|
343
|
-
it('has the namespace', () => {
|
|
344
|
-
assert.typeOf(EventTypes.Navigation.App, 'object')
|
|
345
|
-
})
|
|
346
|
-
|
|
347
|
-
it('has unique events', () => {
|
|
348
|
-
ensureUnique('EventTypes.Navigation.App', EventTypes.Navigation.App)
|
|
349
|
-
})
|
|
350
|
-
})
|
|
351
|
-
|
|
352
|
-
describe('Store namespace', () => {
|
|
353
|
-
it('has the namespace', () => {
|
|
354
|
-
assert.typeOf(EventTypes.Navigation.Store, 'object')
|
|
355
|
-
})
|
|
356
|
-
|
|
357
|
-
it('has unique events', () => {
|
|
358
|
-
ensureUnique('EventTypes.Navigation.Store', EventTypes.Navigation.Store)
|
|
359
|
-
})
|
|
360
|
-
})
|
|
361
|
-
})
|
|
362
|
-
})
|
|
363
|
-
})
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// The event names should be unique across all events in all modules.
|
|
2
|
-
const names: string[] = []
|
|
3
|
-
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
|
-
export function ensureUnique(namespace: string, src: any): void {
|
|
6
|
-
for (const [key, value] of Object.entries(src)) {
|
|
7
|
-
const typedValue = value as string
|
|
8
|
-
if (typeof typedValue !== 'string') {
|
|
9
|
-
return
|
|
10
|
-
}
|
|
11
|
-
if (names.includes(typedValue)) {
|
|
12
|
-
throw new Error(`${namespace}.${key} has duplicated event name ${typedValue}`)
|
|
13
|
-
}
|
|
14
|
-
names.push(typedValue)
|
|
15
|
-
}
|
|
16
|
-
}
|