@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,298 +0,0 @@
|
|
|
1
|
-
import { fixture, assert, html, nextFrame, aTimeout } from '@open-wc/testing'
|
|
2
|
-
|
|
3
|
-
import { CodeEditorElement } from '../../../src/elements/code-editor/code-editor.js'
|
|
4
|
-
import '../../../src/elements/code-editor/code-editor.js' // Registers the element
|
|
5
|
-
|
|
6
|
-
import type { Suggestion } from '../../../src/elements/code-editor/internals/types.js'
|
|
7
|
-
import type { FunctionSchema } from '@pawel-up/jexl/schemas/types.js'
|
|
8
|
-
|
|
9
|
-
describe('CodeEditor - Accessibility', () => {
|
|
10
|
-
const sampleFunctionSchemas: FunctionSchema[] = [
|
|
11
|
-
{
|
|
12
|
-
name: 'testFunction',
|
|
13
|
-
description: 'A test function for accessibility testing',
|
|
14
|
-
category: 'test',
|
|
15
|
-
parameters: [
|
|
16
|
-
{
|
|
17
|
-
name: 'param1',
|
|
18
|
-
required: true,
|
|
19
|
-
schema: {
|
|
20
|
-
type: 'string',
|
|
21
|
-
description: 'First parameter',
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
returns: {
|
|
26
|
-
type: 'string',
|
|
27
|
-
description: 'Returns a string',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
]
|
|
31
|
-
|
|
32
|
-
const sampleSuggestions: Suggestion[] = [
|
|
33
|
-
{
|
|
34
|
-
id: 'accessible-suggestion',
|
|
35
|
-
label: 'Accessible Suggestion',
|
|
36
|
-
description: 'A suggestion for accessibility testing',
|
|
37
|
-
suffix: 'string',
|
|
38
|
-
},
|
|
39
|
-
]
|
|
40
|
-
|
|
41
|
-
async function accessibleFixture(): Promise<CodeEditorElement> {
|
|
42
|
-
return fixture(html`
|
|
43
|
-
<code-editor
|
|
44
|
-
label="Accessible Code Editor"
|
|
45
|
-
supportingtext="Enter your code with accessibility support"
|
|
46
|
-
placeholder="Type your code here..."
|
|
47
|
-
.functionSchemas="${sampleFunctionSchemas}"
|
|
48
|
-
.suggestions="${sampleSuggestions}"
|
|
49
|
-
></code-editor>
|
|
50
|
-
`)
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
async function documentationFixture(): Promise<CodeEditorElement> {
|
|
54
|
-
return fixture(html`
|
|
55
|
-
<code-editor
|
|
56
|
-
label="Code Editor with Documentation"
|
|
57
|
-
showdocumentation
|
|
58
|
-
.functionSchemas="${sampleFunctionSchemas}"
|
|
59
|
-
></code-editor>
|
|
60
|
-
`)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
describe('ARIA and Semantic HTML', () => {
|
|
64
|
-
it('should have proper semantic structure', async () => {
|
|
65
|
-
await accessibleFixture()
|
|
66
|
-
await nextFrame()
|
|
67
|
-
|
|
68
|
-
// Test passes if no errors are thrown during fixture creation
|
|
69
|
-
assert.isTrue(true)
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
it('should have accessible labels', async () => {
|
|
73
|
-
const el = await accessibleFixture()
|
|
74
|
-
await nextFrame()
|
|
75
|
-
|
|
76
|
-
// Wait for CodeMirror to initialize
|
|
77
|
-
await aTimeout(100)
|
|
78
|
-
|
|
79
|
-
// Check that the label is properly associated
|
|
80
|
-
const label = el.shadowRoot!.querySelector('.label')
|
|
81
|
-
assert.exists(label)
|
|
82
|
-
assert.equal(label!.textContent, 'Accessible Code Editor')
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
it('should have proper placeholder text', async () => {
|
|
86
|
-
const el = await accessibleFixture()
|
|
87
|
-
await nextFrame()
|
|
88
|
-
|
|
89
|
-
// Wait for CodeMirror to initialize
|
|
90
|
-
await aTimeout(100)
|
|
91
|
-
|
|
92
|
-
assert.equal(el.placeholder, 'Type your code here...')
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
it('should have supporting text for additional context', async () => {
|
|
96
|
-
const el = await accessibleFixture()
|
|
97
|
-
await nextFrame()
|
|
98
|
-
|
|
99
|
-
const supportingText = el.shadowRoot!.querySelector('.supporting-text')
|
|
100
|
-
assert.exists(supportingText)
|
|
101
|
-
assert.equal(supportingText!.textContent, 'Enter your code with accessibility support')
|
|
102
|
-
})
|
|
103
|
-
})
|
|
104
|
-
|
|
105
|
-
describe('Focus Management', () => {
|
|
106
|
-
it('should delegate focus', async () => {
|
|
107
|
-
const el = await accessibleFixture()
|
|
108
|
-
await nextFrame()
|
|
109
|
-
|
|
110
|
-
// The element should have delegated focus
|
|
111
|
-
assert.isTrue(el.shadowRoot!.delegatesFocus)
|
|
112
|
-
})
|
|
113
|
-
|
|
114
|
-
// These are failing in the CI environment, so skipping for now
|
|
115
|
-
// They work fine in local testing
|
|
116
|
-
it.skip('should be focusable via keyboard', async () => {
|
|
117
|
-
const el = await accessibleFixture()
|
|
118
|
-
await nextFrame()
|
|
119
|
-
|
|
120
|
-
// Element should be able to receive focus
|
|
121
|
-
el.focus()
|
|
122
|
-
await nextFrame()
|
|
123
|
-
|
|
124
|
-
const surface = el.shadowRoot!.querySelector('.surface')
|
|
125
|
-
assert.isTrue(surface!.classList.contains('has-focus'))
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
it.skip('should maintain focus state visually', async () => {
|
|
129
|
-
const el = await accessibleFixture()
|
|
130
|
-
await nextFrame()
|
|
131
|
-
|
|
132
|
-
// Check initial state
|
|
133
|
-
const surface = el.shadowRoot!.querySelector('.surface')
|
|
134
|
-
assert.isFalse(surface!.classList.contains('has-focus'))
|
|
135
|
-
|
|
136
|
-
// Focus the element
|
|
137
|
-
el.focus()
|
|
138
|
-
await nextFrame()
|
|
139
|
-
|
|
140
|
-
assert.isTrue(surface!.classList.contains('has-focus'))
|
|
141
|
-
})
|
|
142
|
-
})
|
|
143
|
-
|
|
144
|
-
describe('Error States and Feedback', () => {
|
|
145
|
-
it('should indicate invalid state accessibly', async () => {
|
|
146
|
-
const el = await accessibleFixture()
|
|
147
|
-
el.invalid = true
|
|
148
|
-
await nextFrame()
|
|
149
|
-
|
|
150
|
-
// Check that invalid state is reflected
|
|
151
|
-
assert.isTrue(el.invalid)
|
|
152
|
-
assert.isTrue(el.hasAttribute('invalid'))
|
|
153
|
-
|
|
154
|
-
const surface = el.shadowRoot!.querySelector('.surface')
|
|
155
|
-
assert.isTrue(surface!.classList.contains('invalid'))
|
|
156
|
-
})
|
|
157
|
-
|
|
158
|
-
it('should handle disabled state properly', async () => {
|
|
159
|
-
const el = await accessibleFixture()
|
|
160
|
-
el.disabled = true
|
|
161
|
-
await nextFrame()
|
|
162
|
-
|
|
163
|
-
// Check that disabled state is reflected
|
|
164
|
-
assert.isTrue(el.disabled)
|
|
165
|
-
assert.isTrue(el.hasAttribute('disabled'))
|
|
166
|
-
|
|
167
|
-
// Wait for CodeMirror to update
|
|
168
|
-
await aTimeout(100)
|
|
169
|
-
})
|
|
170
|
-
|
|
171
|
-
it('should indicate required state', async () => {
|
|
172
|
-
const el = await accessibleFixture()
|
|
173
|
-
el.required = true
|
|
174
|
-
await nextFrame()
|
|
175
|
-
|
|
176
|
-
assert.isTrue(el.required)
|
|
177
|
-
})
|
|
178
|
-
})
|
|
179
|
-
|
|
180
|
-
describe('Documentation Accessibility', () => {
|
|
181
|
-
it('should have accessible documentation buttons', async () => {
|
|
182
|
-
const el = await documentationFixture()
|
|
183
|
-
await nextFrame()
|
|
184
|
-
|
|
185
|
-
assert.isTrue(el.showDocumentation)
|
|
186
|
-
assert.isAtLeast(el.functionSchemas.length, 1)
|
|
187
|
-
})
|
|
188
|
-
|
|
189
|
-
it('should provide proper ARIA labels for documentation', async () => {
|
|
190
|
-
const el = await documentationFixture()
|
|
191
|
-
await nextFrame()
|
|
192
|
-
|
|
193
|
-
// The documentation feature should be properly configured
|
|
194
|
-
assert.isTrue(el.showDocumentation)
|
|
195
|
-
})
|
|
196
|
-
})
|
|
197
|
-
|
|
198
|
-
describe('Keyboard Navigation', () => {
|
|
199
|
-
it('should handle Tab navigation appropriately', async () => {
|
|
200
|
-
const el = await accessibleFixture()
|
|
201
|
-
await nextFrame()
|
|
202
|
-
|
|
203
|
-
// Element should be in the tab order when not disabled
|
|
204
|
-
assert.isFalse(el.disabled)
|
|
205
|
-
|
|
206
|
-
// When disabled, it should not interfere with tab order
|
|
207
|
-
el.disabled = true
|
|
208
|
-
await nextFrame()
|
|
209
|
-
assert.isTrue(el.disabled)
|
|
210
|
-
})
|
|
211
|
-
})
|
|
212
|
-
|
|
213
|
-
describe('Screen Reader Support', () => {
|
|
214
|
-
it('should provide appropriate text content for screen readers', async () => {
|
|
215
|
-
const el = await accessibleFixture()
|
|
216
|
-
await nextFrame()
|
|
217
|
-
|
|
218
|
-
// Wait for CodeMirror to initialize
|
|
219
|
-
await aTimeout(100)
|
|
220
|
-
|
|
221
|
-
// Check that the element has accessible content
|
|
222
|
-
const label = el.shadowRoot!.querySelector('.label')
|
|
223
|
-
assert.exists(label)
|
|
224
|
-
assert.isString(label!.textContent)
|
|
225
|
-
})
|
|
226
|
-
|
|
227
|
-
it('should announce value changes appropriately', async () => {
|
|
228
|
-
const el = await accessibleFixture()
|
|
229
|
-
await nextFrame()
|
|
230
|
-
|
|
231
|
-
// Set a value
|
|
232
|
-
el.value = 'test content for screen reader'
|
|
233
|
-
await nextFrame()
|
|
234
|
-
|
|
235
|
-
assert.equal(el.value, 'test content for screen reader')
|
|
236
|
-
})
|
|
237
|
-
|
|
238
|
-
it('should provide context for code suggestions', async () => {
|
|
239
|
-
const el = await accessibleFixture()
|
|
240
|
-
await nextFrame()
|
|
241
|
-
|
|
242
|
-
// Test that suggestions are configured
|
|
243
|
-
assert.isAtLeast(el.suggestions.length, 1)
|
|
244
|
-
assert.exists(el.suggestions[0].description)
|
|
245
|
-
})
|
|
246
|
-
})
|
|
247
|
-
|
|
248
|
-
describe('Touch and Mobile Accessibility', () => {
|
|
249
|
-
it.skip('should be usable on touch devices', async () => {
|
|
250
|
-
const el = await accessibleFixture()
|
|
251
|
-
await el.updateComplete
|
|
252
|
-
|
|
253
|
-
// The editor should be interactive
|
|
254
|
-
el.focus()
|
|
255
|
-
await el.updateComplete
|
|
256
|
-
|
|
257
|
-
const surface = el.shadowRoot!.querySelector('.surface')
|
|
258
|
-
assert.isTrue(surface!.classList.contains('has-focus'))
|
|
259
|
-
})
|
|
260
|
-
|
|
261
|
-
it('should have appropriate touch targets', async () => {
|
|
262
|
-
const el = await accessibleFixture()
|
|
263
|
-
await nextFrame()
|
|
264
|
-
|
|
265
|
-
// Wait for CodeMirror to initialize
|
|
266
|
-
await aTimeout(100)
|
|
267
|
-
|
|
268
|
-
// Check that the editor container exists and is sizeable
|
|
269
|
-
const editorContainer = el.shadowRoot!.querySelector('.editor-container')
|
|
270
|
-
assert.exists(editorContainer)
|
|
271
|
-
})
|
|
272
|
-
})
|
|
273
|
-
|
|
274
|
-
describe('Form Integration Accessibility', () => {
|
|
275
|
-
it('should integrate properly with forms', async () => {
|
|
276
|
-
const el = await accessibleFixture()
|
|
277
|
-
el.name = 'accessible-editor'
|
|
278
|
-
el.required = true
|
|
279
|
-
await nextFrame()
|
|
280
|
-
|
|
281
|
-
assert.equal(el.name, 'accessible-editor')
|
|
282
|
-
assert.isTrue(el.required)
|
|
283
|
-
})
|
|
284
|
-
|
|
285
|
-
it('should provide appropriate validation feedback', async () => {
|
|
286
|
-
const el = await accessibleFixture()
|
|
287
|
-
el.invalid = true
|
|
288
|
-
el.supportingText = 'Please enter valid code'
|
|
289
|
-
await nextFrame()
|
|
290
|
-
|
|
291
|
-
assert.isTrue(el.invalid)
|
|
292
|
-
|
|
293
|
-
const supportingText = el.shadowRoot!.querySelector('.supporting-text')
|
|
294
|
-
assert.exists(supportingText)
|
|
295
|
-
assert.equal(supportingText!.textContent, 'Please enter valid code')
|
|
296
|
-
})
|
|
297
|
-
})
|
|
298
|
-
})
|