@furystack/shades-common-components 12.4.0 → 12.5.0
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 +56 -0
- package/esm/components/app-bar-link.spec.js +16 -19
- package/esm/components/app-bar-link.spec.js.map +1 -1
- package/esm/components/app-bar.spec.js +6 -4
- package/esm/components/app-bar.spec.js.map +1 -1
- package/esm/components/avatar.spec.js +9 -9
- package/esm/components/avatar.spec.js.map +1 -1
- package/esm/components/breadcrumb.spec.js +2 -2
- package/esm/components/breadcrumb.spec.js.map +1 -1
- package/esm/components/button-group.d.ts +32 -0
- package/esm/components/button-group.d.ts.map +1 -1
- package/esm/components/button-group.js +26 -2
- package/esm/components/button-group.js.map +1 -1
- package/esm/components/button-group.spec.js +127 -11
- package/esm/components/button-group.spec.js.map +1 -1
- package/esm/components/button.spec.js +4 -4
- package/esm/components/button.spec.js.map +1 -1
- package/esm/components/cache-view.spec.js +2 -3
- package/esm/components/cache-view.spec.js.map +1 -1
- package/esm/components/carousel.spec.js +47 -47
- package/esm/components/carousel.spec.js.map +1 -1
- package/esm/components/circular-progress.spec.js +2 -2
- package/esm/components/command-palette/command-palette-input.spec.js +23 -19
- package/esm/components/command-palette/command-palette-input.spec.js.map +1 -1
- package/esm/components/command-palette/command-palette-suggestion-list.spec.js +27 -27
- package/esm/components/command-palette/command-palette-suggestion-list.spec.js.map +1 -1
- package/esm/components/command-palette/index.spec.js +64 -51
- package/esm/components/command-palette/index.spec.js.map +1 -1
- package/esm/components/context-menu/context-menu.spec.js +33 -33
- package/esm/components/context-menu/context-menu.spec.js.map +1 -1
- package/esm/components/data-grid/body.spec.js +13 -13
- package/esm/components/data-grid/body.spec.js.map +1 -1
- package/esm/components/data-grid/data-grid-row.spec.js +8 -8
- package/esm/components/data-grid/data-grid-row.spec.js.map +1 -1
- package/esm/components/data-grid/data-grid.d.ts +40 -2
- package/esm/components/data-grid/data-grid.d.ts.map +1 -1
- package/esm/components/data-grid/data-grid.js +7 -10
- package/esm/components/data-grid/data-grid.js.map +1 -1
- package/esm/components/data-grid/data-grid.spec.js +71 -28
- package/esm/components/data-grid/data-grid.spec.js.map +1 -1
- package/esm/components/data-grid/filters/boolean-filter.d.ts +12 -0
- package/esm/components/data-grid/filters/boolean-filter.d.ts.map +1 -0
- package/esm/components/data-grid/filters/boolean-filter.js +27 -0
- package/esm/components/data-grid/filters/boolean-filter.js.map +1 -0
- package/esm/components/data-grid/filters/boolean-filter.spec.d.ts +2 -0
- package/esm/components/data-grid/filters/boolean-filter.spec.d.ts.map +1 -0
- package/esm/components/data-grid/filters/boolean-filter.spec.js +114 -0
- package/esm/components/data-grid/filters/boolean-filter.spec.js.map +1 -0
- package/esm/components/data-grid/filters/date-filter.d.ts +12 -0
- package/esm/components/data-grid/filters/date-filter.d.ts.map +1 -0
- package/esm/components/data-grid/filters/date-filter.js +109 -0
- package/esm/components/data-grid/filters/date-filter.js.map +1 -0
- package/esm/components/data-grid/filters/date-filter.spec.d.ts +2 -0
- package/esm/components/data-grid/filters/date-filter.spec.d.ts.map +1 -0
- package/esm/components/data-grid/filters/date-filter.spec.js +145 -0
- package/esm/components/data-grid/filters/date-filter.spec.js.map +1 -0
- package/esm/components/data-grid/filters/enum-filter.d.ts +16 -0
- package/esm/components/data-grid/filters/enum-filter.d.ts.map +1 -0
- package/esm/components/data-grid/filters/enum-filter.js +72 -0
- package/esm/components/data-grid/filters/enum-filter.js.map +1 -0
- package/esm/components/data-grid/filters/enum-filter.spec.d.ts +2 -0
- package/esm/components/data-grid/filters/enum-filter.spec.d.ts.map +1 -0
- package/esm/components/data-grid/filters/enum-filter.spec.js +136 -0
- package/esm/components/data-grid/filters/enum-filter.spec.js.map +1 -0
- package/esm/components/data-grid/filters/filter-dropdown.d.ts +6 -0
- package/esm/components/data-grid/filters/filter-dropdown.d.ts.map +1 -0
- package/esm/components/data-grid/filters/filter-dropdown.js +41 -0
- package/esm/components/data-grid/filters/filter-dropdown.js.map +1 -0
- package/esm/components/data-grid/filters/filter-dropdown.spec.d.ts +2 -0
- package/esm/components/data-grid/filters/filter-dropdown.spec.d.ts.map +1 -0
- package/esm/components/data-grid/filters/filter-dropdown.spec.js +69 -0
- package/esm/components/data-grid/filters/filter-dropdown.spec.js.map +1 -0
- package/esm/components/data-grid/filters/filter-styles.d.ts +24 -0
- package/esm/components/data-grid/filters/filter-styles.d.ts.map +1 -0
- package/esm/components/data-grid/filters/filter-styles.js +25 -0
- package/esm/components/data-grid/filters/filter-styles.js.map +1 -0
- package/esm/components/data-grid/filters/index.d.ts +7 -0
- package/esm/components/data-grid/filters/index.d.ts.map +1 -0
- package/esm/components/data-grid/filters/index.js +7 -0
- package/esm/components/data-grid/filters/index.js.map +1 -0
- package/esm/components/data-grid/filters/number-filter.d.ts +12 -0
- package/esm/components/data-grid/filters/number-filter.d.ts.map +1 -0
- package/esm/components/data-grid/filters/number-filter.js +65 -0
- package/esm/components/data-grid/filters/number-filter.js.map +1 -0
- package/esm/components/data-grid/filters/number-filter.spec.d.ts +2 -0
- package/esm/components/data-grid/filters/number-filter.spec.d.ts.map +1 -0
- package/esm/components/data-grid/filters/number-filter.spec.js +142 -0
- package/esm/components/data-grid/filters/number-filter.spec.js.map +1 -0
- package/esm/components/data-grid/filters/string-filter.d.ts +12 -0
- package/esm/components/data-grid/filters/string-filter.d.ts.map +1 -0
- package/esm/components/data-grid/filters/string-filter.js +63 -0
- package/esm/components/data-grid/filters/string-filter.js.map +1 -0
- package/esm/components/data-grid/filters/string-filter.spec.d.ts +2 -0
- package/esm/components/data-grid/filters/string-filter.spec.d.ts.map +1 -0
- package/esm/components/data-grid/filters/string-filter.spec.js +128 -0
- package/esm/components/data-grid/filters/string-filter.spec.js.map +1 -0
- package/esm/components/data-grid/footer.d.ts.map +1 -1
- package/esm/components/data-grid/footer.js +24 -9
- package/esm/components/data-grid/footer.js.map +1 -1
- package/esm/components/data-grid/footer.spec.js +38 -36
- package/esm/components/data-grid/footer.spec.js.map +1 -1
- package/esm/components/data-grid/header.d.ts +6 -9
- package/esm/components/data-grid/header.d.ts.map +1 -1
- package/esm/components/data-grid/header.js +51 -117
- package/esm/components/data-grid/header.js.map +1 -1
- package/esm/components/data-grid/header.spec.js +116 -187
- package/esm/components/data-grid/header.spec.js.map +1 -1
- package/esm/components/data-grid/index.d.ts +1 -0
- package/esm/components/data-grid/index.d.ts.map +1 -1
- package/esm/components/data-grid/index.js +1 -0
- package/esm/components/data-grid/index.js.map +1 -1
- package/esm/components/data-grid/selection-cell.spec.js +8 -8
- package/esm/components/data-grid/selection-cell.spec.js.map +1 -1
- package/esm/components/drawer/drawer-toggle-button.spec.js +22 -22
- package/esm/components/drawer/drawer-toggle-button.spec.js.map +1 -1
- package/esm/components/drawer/index.spec.js +36 -36
- package/esm/components/drawer/index.spec.js.map +1 -1
- package/esm/components/dropdown.spec.js +38 -30
- package/esm/components/dropdown.spec.js.map +1 -1
- package/esm/components/fab.spec.js +4 -4
- package/esm/components/fab.spec.js.map +1 -1
- package/esm/components/form.spec.js +37 -37
- package/esm/components/form.spec.js.map +1 -1
- package/esm/components/grid.spec.js +3 -3
- package/esm/components/grid.spec.js.map +1 -1
- package/esm/components/image.spec.js +55 -52
- package/esm/components/image.spec.js.map +1 -1
- package/esm/components/inputs/autocomplete.spec.js +7 -14
- package/esm/components/inputs/autocomplete.spec.js.map +1 -1
- package/esm/components/inputs/checkbox.spec.js +22 -22
- package/esm/components/inputs/checkbox.spec.js.map +1 -1
- package/esm/components/inputs/input-number.spec.js +47 -47
- package/esm/components/inputs/input-number.spec.js.map +1 -1
- package/esm/components/inputs/input.spec.js +53 -53
- package/esm/components/inputs/input.spec.js.map +1 -1
- package/esm/components/inputs/radio-group.spec.js +14 -14
- package/esm/components/inputs/radio-group.spec.js.map +1 -1
- package/esm/components/inputs/radio.spec.js +16 -16
- package/esm/components/inputs/radio.spec.js.map +1 -1
- package/esm/components/inputs/select.spec.js +74 -74
- package/esm/components/inputs/select.spec.js.map +1 -1
- package/esm/components/inputs/slider.spec.js +16 -16
- package/esm/components/inputs/slider.spec.js.map +1 -1
- package/esm/components/inputs/switch.spec.js +24 -24
- package/esm/components/inputs/switch.spec.js.map +1 -1
- package/esm/components/inputs/text-area.spec.js +17 -17
- package/esm/components/inputs/text-area.spec.js.map +1 -1
- package/esm/components/linear-progress.spec.js +2 -2
- package/esm/components/list/list.spec.js +36 -36
- package/esm/components/list/list.spec.js.map +1 -1
- package/esm/components/markdown/markdown-display.spec.js +15 -15
- package/esm/components/markdown/markdown-display.spec.js.map +1 -1
- package/esm/components/markdown/markdown-editor.spec.js +8 -8
- package/esm/components/markdown/markdown-editor.spec.js.map +1 -1
- package/esm/components/markdown/markdown-input.spec.js +17 -17
- package/esm/components/markdown/markdown-input.spec.js.map +1 -1
- package/esm/components/menu/menu.spec.js +28 -28
- package/esm/components/menu/menu.spec.js.map +1 -1
- package/esm/components/modal.spec.js +15 -18
- package/esm/components/modal.spec.js.map +1 -1
- package/esm/components/noty-list.spec.js +25 -23
- package/esm/components/noty-list.spec.js.map +1 -1
- package/esm/components/page-container/index.spec.js +16 -16
- package/esm/components/page-container/index.spec.js.map +1 -1
- package/esm/components/page-container/page-header.spec.js +16 -16
- package/esm/components/page-container/page-header.spec.js.map +1 -1
- package/esm/components/page-layout/index.spec.js +29 -29
- package/esm/components/page-layout/index.spec.js.map +1 -1
- package/esm/components/paper.spec.js +3 -3
- package/esm/components/paper.spec.js.map +1 -1
- package/esm/components/rating.spec.js +61 -61
- package/esm/components/rating.spec.js.map +1 -1
- package/esm/components/skeleton.spec.js +10 -6
- package/esm/components/skeleton.spec.js.map +1 -1
- package/esm/components/suggest/suggest-input.spec.js +4 -10
- package/esm/components/suggest/suggest-input.spec.js.map +1 -1
- package/esm/components/tabs.spec.js +30 -30
- package/esm/components/tabs.spec.js.map +1 -1
- package/esm/components/tree/tree.spec.js +27 -27
- package/esm/components/tree/tree.spec.js.map +1 -1
- package/esm/components/typography.spec.js +3 -3
- package/esm/components/typography.spec.js.map +1 -1
- package/esm/components/wizard/index.spec.js +5 -5
- package/esm/components/wizard/index.spec.js.map +1 -1
- package/esm/utils/promisify-animation.d.ts.map +1 -1
- package/esm/utils/promisify-animation.js +3 -0
- package/esm/utils/promisify-animation.js.map +1 -1
- package/package.json +2 -2
- package/src/components/app-bar-link.spec.tsx +16 -19
- package/src/components/app-bar.spec.tsx +6 -4
- package/src/components/avatar.spec.tsx +9 -9
- package/src/components/breadcrumb.spec.tsx +2 -2
- package/src/components/button-group.spec.tsx +155 -11
- package/src/components/button-group.tsx +49 -2
- package/src/components/button.spec.tsx +4 -4
- package/src/components/cache-view.spec.tsx +3 -3
- package/src/components/carousel.spec.tsx +47 -47
- package/src/components/circular-progress.spec.tsx +2 -2
- package/src/components/command-palette/command-palette-input.spec.tsx +23 -19
- package/src/components/command-palette/command-palette-suggestion-list.spec.tsx +27 -27
- package/src/components/command-palette/index.spec.tsx +64 -51
- package/src/components/context-menu/context-menu.spec.tsx +33 -33
- package/src/components/data-grid/body.spec.tsx +13 -13
- package/src/components/data-grid/data-grid-row.spec.tsx +8 -8
- package/src/components/data-grid/data-grid.spec.tsx +106 -28
- package/src/components/data-grid/data-grid.tsx +44 -11
- package/src/components/data-grid/filters/boolean-filter.spec.tsx +142 -0
- package/src/components/data-grid/filters/boolean-filter.tsx +45 -0
- package/src/components/data-grid/filters/date-filter.spec.tsx +181 -0
- package/src/components/data-grid/filters/date-filter.tsx +162 -0
- package/src/components/data-grid/filters/enum-filter.spec.tsx +168 -0
- package/src/components/data-grid/filters/enum-filter.tsx +119 -0
- package/src/components/data-grid/filters/filter-dropdown.spec.tsx +89 -0
- package/src/components/data-grid/filters/filter-dropdown.tsx +60 -0
- package/src/components/data-grid/filters/filter-styles.ts +26 -0
- package/src/components/data-grid/filters/index.ts +6 -0
- package/src/components/data-grid/filters/number-filter.spec.tsx +174 -0
- package/src/components/data-grid/filters/number-filter.tsx +115 -0
- package/src/components/data-grid/filters/string-filter.spec.tsx +157 -0
- package/src/components/data-grid/filters/string-filter.tsx +112 -0
- package/src/components/data-grid/footer.spec.tsx +38 -36
- package/src/components/data-grid/footer.tsx +21 -8
- package/src/components/data-grid/header.spec.tsx +128 -212
- package/src/components/data-grid/header.tsx +95 -183
- package/src/components/data-grid/index.tsx +1 -0
- package/src/components/data-grid/selection-cell.spec.tsx +8 -8
- package/src/components/drawer/drawer-toggle-button.spec.tsx +22 -22
- package/src/components/drawer/index.spec.tsx +36 -36
- package/src/components/dropdown.spec.tsx +38 -30
- package/src/components/fab.spec.tsx +4 -4
- package/src/components/form.spec.tsx +37 -37
- package/src/components/grid.spec.tsx +3 -3
- package/src/components/image.spec.tsx +55 -52
- package/src/components/inputs/autocomplete.spec.tsx +7 -14
- package/src/components/inputs/checkbox.spec.tsx +22 -22
- package/src/components/inputs/input-number.spec.tsx +47 -47
- package/src/components/inputs/input.spec.tsx +53 -53
- package/src/components/inputs/radio-group.spec.tsx +14 -14
- package/src/components/inputs/radio.spec.tsx +16 -16
- package/src/components/inputs/select.spec.tsx +74 -74
- package/src/components/inputs/slider.spec.tsx +16 -16
- package/src/components/inputs/switch.spec.tsx +24 -24
- package/src/components/inputs/text-area.spec.tsx +17 -17
- package/src/components/linear-progress.spec.tsx +2 -2
- package/src/components/list/list.spec.tsx +36 -36
- package/src/components/markdown/markdown-display.spec.tsx +15 -15
- package/src/components/markdown/markdown-editor.spec.tsx +8 -8
- package/src/components/markdown/markdown-input.spec.tsx +17 -17
- package/src/components/menu/menu.spec.tsx +28 -28
- package/src/components/modal.spec.tsx +15 -18
- package/src/components/noty-list.spec.tsx +25 -23
- package/src/components/page-container/index.spec.tsx +16 -16
- package/src/components/page-container/page-header.spec.tsx +16 -16
- package/src/components/page-layout/index.spec.tsx +29 -29
- package/src/components/paper.spec.tsx +3 -3
- package/src/components/rating.spec.tsx +61 -61
- package/src/components/skeleton.spec.tsx +10 -6
- package/src/components/suggest/suggest-input.spec.tsx +4 -10
- package/src/components/tabs.spec.tsx +30 -30
- package/src/components/tree/tree.spec.tsx +27 -27
- package/src/components/typography.spec.tsx +3 -3
- package/src/components/wizard/index.spec.tsx +5 -5
- package/src/utils/promisify-animation.ts +3 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Injector } from '@furystack/inject'
|
|
2
|
-
import { createComponent, initializeShadeRoot } from '@furystack/shades'
|
|
3
|
-
import {
|
|
2
|
+
import { createComponent, flushUpdates, initializeShadeRoot } from '@furystack/shades'
|
|
3
|
+
import { usingAsync } from '@furystack/utils'
|
|
4
4
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
|
5
5
|
import { ThemeProviderService } from '../../services/theme-provider-service.js'
|
|
6
6
|
import { Form, FormService } from '../form.js'
|
|
@@ -26,7 +26,7 @@ describe('Input', () => {
|
|
|
26
26
|
jsxElement: <Input />,
|
|
27
27
|
})
|
|
28
28
|
|
|
29
|
-
await
|
|
29
|
+
await flushUpdates()
|
|
30
30
|
|
|
31
31
|
const input = document.querySelector('shade-input')
|
|
32
32
|
expect(input).not.toBeNull()
|
|
@@ -43,7 +43,7 @@ describe('Input', () => {
|
|
|
43
43
|
jsxElement: <Input name="testField" />,
|
|
44
44
|
})
|
|
45
45
|
|
|
46
|
-
await
|
|
46
|
+
await flushUpdates()
|
|
47
47
|
|
|
48
48
|
const input = document.querySelector('shade-input input') as HTMLInputElement
|
|
49
49
|
expect(input).not.toBeNull()
|
|
@@ -61,7 +61,7 @@ describe('Input', () => {
|
|
|
61
61
|
jsxElement: <Input labelTitle="Test Label" />,
|
|
62
62
|
})
|
|
63
63
|
|
|
64
|
-
await
|
|
64
|
+
await flushUpdates()
|
|
65
65
|
|
|
66
66
|
const label = document.querySelector('shade-input label') as HTMLLabelElement
|
|
67
67
|
expect(label).not.toBeNull()
|
|
@@ -80,7 +80,7 @@ describe('Input', () => {
|
|
|
80
80
|
jsxElement: <Input variant="outlined" />,
|
|
81
81
|
})
|
|
82
82
|
|
|
83
|
-
await
|
|
83
|
+
await flushUpdates()
|
|
84
84
|
|
|
85
85
|
const input = document.querySelector('shade-input') as HTMLElement
|
|
86
86
|
expect(input).not.toBeNull()
|
|
@@ -98,7 +98,7 @@ describe('Input', () => {
|
|
|
98
98
|
jsxElement: <Input variant="contained" />,
|
|
99
99
|
})
|
|
100
100
|
|
|
101
|
-
await
|
|
101
|
+
await flushUpdates()
|
|
102
102
|
|
|
103
103
|
const input = document.querySelector('shade-input') as HTMLElement
|
|
104
104
|
expect(input).not.toBeNull()
|
|
@@ -116,7 +116,7 @@ describe('Input', () => {
|
|
|
116
116
|
jsxElement: <Input />,
|
|
117
117
|
})
|
|
118
118
|
|
|
119
|
-
await
|
|
119
|
+
await flushUpdates()
|
|
120
120
|
|
|
121
121
|
const input = document.querySelector('shade-input') as HTMLElement
|
|
122
122
|
expect(input).not.toBeNull()
|
|
@@ -136,7 +136,7 @@ describe('Input', () => {
|
|
|
136
136
|
jsxElement: <Input disabled />,
|
|
137
137
|
})
|
|
138
138
|
|
|
139
|
-
await
|
|
139
|
+
await flushUpdates()
|
|
140
140
|
|
|
141
141
|
const input = document.querySelector('shade-input') as HTMLElement
|
|
142
142
|
expect(input).not.toBeNull()
|
|
@@ -154,7 +154,7 @@ describe('Input', () => {
|
|
|
154
154
|
jsxElement: <Input disabled={false} />,
|
|
155
155
|
})
|
|
156
156
|
|
|
157
|
-
await
|
|
157
|
+
await flushUpdates()
|
|
158
158
|
|
|
159
159
|
const input = document.querySelector('shade-input') as HTMLElement
|
|
160
160
|
expect(input).not.toBeNull()
|
|
@@ -175,13 +175,13 @@ describe('Input', () => {
|
|
|
175
175
|
jsxElement: <Input name="email" getValidationResult={getValidationResult} />,
|
|
176
176
|
})
|
|
177
177
|
|
|
178
|
-
await
|
|
178
|
+
await flushUpdates()
|
|
179
179
|
|
|
180
180
|
const input = document.querySelector('shade-input input') as HTMLInputElement
|
|
181
181
|
input.value = 'test@example.com'
|
|
182
182
|
input.dispatchEvent(new Event('change', { bubbles: true }))
|
|
183
183
|
|
|
184
|
-
await
|
|
184
|
+
await flushUpdates()
|
|
185
185
|
|
|
186
186
|
expect(getValidationResult).toHaveBeenCalled()
|
|
187
187
|
})
|
|
@@ -203,14 +203,14 @@ describe('Input', () => {
|
|
|
203
203
|
),
|
|
204
204
|
})
|
|
205
205
|
|
|
206
|
-
await
|
|
206
|
+
await flushUpdates()
|
|
207
207
|
|
|
208
208
|
const inputWrapper = document.querySelector('shade-input') as HTMLElement
|
|
209
209
|
const input = inputWrapper.querySelector('input') as HTMLInputElement
|
|
210
210
|
input.value = 'invalid'
|
|
211
211
|
input.dispatchEvent(new Event('change', { bubbles: true }))
|
|
212
212
|
|
|
213
|
-
await
|
|
213
|
+
await flushUpdates()
|
|
214
214
|
|
|
215
215
|
expect(inputWrapper.hasAttribute('data-invalid')).toBe(true)
|
|
216
216
|
})
|
|
@@ -226,14 +226,14 @@ describe('Input', () => {
|
|
|
226
226
|
jsxElement: <Input name="email" getValidationResult={() => ({ isValid: true })} value="valid@email.com" />,
|
|
227
227
|
})
|
|
228
228
|
|
|
229
|
-
await
|
|
229
|
+
await flushUpdates()
|
|
230
230
|
|
|
231
231
|
const inputWrapper = document.querySelector('shade-input') as HTMLElement
|
|
232
232
|
const input = inputWrapper.querySelector('input') as HTMLInputElement
|
|
233
233
|
input.value = 'valid@email.com'
|
|
234
234
|
input.dispatchEvent(new Event('change', { bubbles: true }))
|
|
235
235
|
|
|
236
|
-
await
|
|
236
|
+
await flushUpdates()
|
|
237
237
|
|
|
238
238
|
expect(inputWrapper.hasAttribute('data-invalid')).toBe(false)
|
|
239
239
|
})
|
|
@@ -251,14 +251,14 @@ describe('Input', () => {
|
|
|
251
251
|
),
|
|
252
252
|
})
|
|
253
253
|
|
|
254
|
-
await
|
|
254
|
+
await flushUpdates()
|
|
255
255
|
|
|
256
256
|
const inputWrapper = document.querySelector('shade-input') as HTMLElement
|
|
257
257
|
const input = inputWrapper.querySelector('input') as HTMLInputElement
|
|
258
258
|
input.value = ''
|
|
259
259
|
input.dispatchEvent(new Event('change', { bubbles: true }))
|
|
260
260
|
|
|
261
|
-
await
|
|
261
|
+
await flushUpdates()
|
|
262
262
|
|
|
263
263
|
const helperText = inputWrapper.querySelector('.helperText') as HTMLElement
|
|
264
264
|
expect(helperText.textContent).toBe('Email is required')
|
|
@@ -275,7 +275,7 @@ describe('Input', () => {
|
|
|
275
275
|
jsxElement: <Input name="field" required />,
|
|
276
276
|
})
|
|
277
277
|
|
|
278
|
-
await
|
|
278
|
+
await flushUpdates()
|
|
279
279
|
|
|
280
280
|
const inputWrapper = document.querySelector('shade-input') as HTMLElement
|
|
281
281
|
const input = inputWrapper.querySelector('input') as HTMLInputElement
|
|
@@ -283,7 +283,7 @@ describe('Input', () => {
|
|
|
283
283
|
const invalidEvent = new Event('invalid', { bubbles: true, cancelable: true })
|
|
284
284
|
input.dispatchEvent(invalidEvent)
|
|
285
285
|
|
|
286
|
-
await
|
|
286
|
+
await flushUpdates()
|
|
287
287
|
|
|
288
288
|
const helperText = inputWrapper.querySelector('.helperText') as HTMLElement
|
|
289
289
|
expect(helperText.textContent).toBe('Value is required')
|
|
@@ -302,7 +302,7 @@ describe('Input', () => {
|
|
|
302
302
|
jsxElement: <Input name="email" getHelperText={() => 'Enter your email address'} />,
|
|
303
303
|
})
|
|
304
304
|
|
|
305
|
-
await
|
|
305
|
+
await flushUpdates()
|
|
306
306
|
|
|
307
307
|
const inputWrapper = document.querySelector('shade-input') as HTMLElement
|
|
308
308
|
const helperText = inputWrapper.querySelector('.helperText') as HTMLElement
|
|
@@ -324,13 +324,13 @@ describe('Input', () => {
|
|
|
324
324
|
),
|
|
325
325
|
})
|
|
326
326
|
|
|
327
|
-
await
|
|
327
|
+
await flushUpdates()
|
|
328
328
|
|
|
329
329
|
const input = document.querySelector('shade-input input') as HTMLInputElement
|
|
330
330
|
input.value = 'test'
|
|
331
331
|
input.dispatchEvent(new Event('change', { bubbles: true }))
|
|
332
332
|
|
|
333
|
-
await
|
|
333
|
+
await flushUpdates()
|
|
334
334
|
|
|
335
335
|
expect(getHelperText).toHaveBeenCalled()
|
|
336
336
|
|
|
@@ -363,13 +363,13 @@ describe('Input', () => {
|
|
|
363
363
|
),
|
|
364
364
|
})
|
|
365
365
|
|
|
366
|
-
await
|
|
366
|
+
await flushUpdates()
|
|
367
367
|
|
|
368
368
|
const input = document.querySelector('shade-input input') as HTMLInputElement
|
|
369
369
|
input.value = 'test'
|
|
370
370
|
input.dispatchEvent(new Event('change', { bubbles: true }))
|
|
371
371
|
|
|
372
|
-
await
|
|
372
|
+
await flushUpdates()
|
|
373
373
|
|
|
374
374
|
const inputWrapper = document.querySelector('shade-input') as HTMLElement
|
|
375
375
|
const helperText = inputWrapper.querySelector('.helperText') as HTMLElement
|
|
@@ -390,7 +390,7 @@ describe('Input', () => {
|
|
|
390
390
|
jsxElement: <Input name="search" getStartIcon={() => '🔍'} />,
|
|
391
391
|
})
|
|
392
392
|
|
|
393
|
-
await
|
|
393
|
+
await flushUpdates()
|
|
394
394
|
|
|
395
395
|
const inputWrapper = document.querySelector('shade-input') as HTMLElement
|
|
396
396
|
const startIcon = inputWrapper.querySelector('.startIcon') as HTMLElement
|
|
@@ -410,7 +410,7 @@ describe('Input', () => {
|
|
|
410
410
|
jsxElement: <Input name="password" getEndIcon={() => '👁️'} />,
|
|
411
411
|
})
|
|
412
412
|
|
|
413
|
-
await
|
|
413
|
+
await flushUpdates()
|
|
414
414
|
|
|
415
415
|
const inputWrapper = document.querySelector('shade-input') as HTMLElement
|
|
416
416
|
const endIcon = inputWrapper.querySelector('.endIcon') as HTMLElement
|
|
@@ -430,7 +430,7 @@ describe('Input', () => {
|
|
|
430
430
|
jsxElement: <Input name="field" />,
|
|
431
431
|
})
|
|
432
432
|
|
|
433
|
-
await
|
|
433
|
+
await flushUpdates()
|
|
434
434
|
|
|
435
435
|
const inputWrapper = document.querySelector('shade-input') as HTMLElement
|
|
436
436
|
const startIcon = inputWrapper.querySelector('.startIcon')
|
|
@@ -449,7 +449,7 @@ describe('Input', () => {
|
|
|
449
449
|
jsxElement: <Input name="field" getEndIcon={({ state }) => (state.focused ? '✓' : '○')} />,
|
|
450
450
|
})
|
|
451
451
|
|
|
452
|
-
await
|
|
452
|
+
await flushUpdates()
|
|
453
453
|
|
|
454
454
|
const inputWrapper = document.querySelector('shade-input') as HTMLElement
|
|
455
455
|
const input = inputWrapper.querySelector('input') as HTMLInputElement
|
|
@@ -458,7 +458,7 @@ describe('Input', () => {
|
|
|
458
458
|
expect(endIcon.textContent).toBe('○')
|
|
459
459
|
|
|
460
460
|
input.dispatchEvent(new FocusEvent('focus'))
|
|
461
|
-
await
|
|
461
|
+
await flushUpdates()
|
|
462
462
|
|
|
463
463
|
expect(endIcon.textContent).toBe('✓')
|
|
464
464
|
})
|
|
@@ -476,7 +476,7 @@ describe('Input', () => {
|
|
|
476
476
|
jsxElement: <Input name="field" />,
|
|
477
477
|
})
|
|
478
478
|
|
|
479
|
-
await
|
|
479
|
+
await flushUpdates()
|
|
480
480
|
|
|
481
481
|
const inputWrapper = document.querySelector('shade-input') as HTMLElement
|
|
482
482
|
|
|
@@ -498,7 +498,7 @@ describe('Input', () => {
|
|
|
498
498
|
jsxElement: <Input name="field" defaultColor="secondary" />,
|
|
499
499
|
})
|
|
500
500
|
|
|
501
|
-
await
|
|
501
|
+
await flushUpdates()
|
|
502
502
|
|
|
503
503
|
const inputWrapper = document.querySelector('shade-input') as HTMLElement
|
|
504
504
|
|
|
@@ -522,13 +522,13 @@ describe('Input', () => {
|
|
|
522
522
|
jsxElement: <Input name="field" onTextChange={onTextChange} />,
|
|
523
523
|
})
|
|
524
524
|
|
|
525
|
-
await
|
|
525
|
+
await flushUpdates()
|
|
526
526
|
|
|
527
527
|
const input = document.querySelector('shade-input input') as HTMLInputElement
|
|
528
528
|
input.value = 'new value'
|
|
529
529
|
input.dispatchEvent(new Event('change', { bubbles: true }))
|
|
530
530
|
|
|
531
|
-
await
|
|
531
|
+
await flushUpdates()
|
|
532
532
|
|
|
533
533
|
expect(onTextChange).toHaveBeenCalledWith('new value')
|
|
534
534
|
})
|
|
@@ -545,13 +545,13 @@ describe('Input', () => {
|
|
|
545
545
|
jsxElement: <Input name="field" onchange={onchange} />,
|
|
546
546
|
})
|
|
547
547
|
|
|
548
|
-
await
|
|
548
|
+
await flushUpdates()
|
|
549
549
|
|
|
550
550
|
const input = document.querySelector('shade-input input') as HTMLInputElement
|
|
551
551
|
input.value = 'test'
|
|
552
552
|
input.dispatchEvent(new Event('change', { bubbles: true }))
|
|
553
553
|
|
|
554
|
-
await
|
|
554
|
+
await flushUpdates()
|
|
555
555
|
|
|
556
556
|
expect(onchange).toHaveBeenCalled()
|
|
557
557
|
})
|
|
@@ -570,12 +570,12 @@ describe('Input', () => {
|
|
|
570
570
|
jsxElement: <Input name="field" getEndIcon={getEndIcon} />,
|
|
571
571
|
})
|
|
572
572
|
|
|
573
|
-
await
|
|
573
|
+
await flushUpdates()
|
|
574
574
|
|
|
575
575
|
const input = document.querySelector('shade-input input') as HTMLInputElement
|
|
576
576
|
input.dispatchEvent(new FocusEvent('focus'))
|
|
577
577
|
|
|
578
|
-
await
|
|
578
|
+
await flushUpdates()
|
|
579
579
|
|
|
580
580
|
expect(getEndIcon).toHaveBeenLastCalledWith(
|
|
581
581
|
expect.objectContaining({
|
|
@@ -598,15 +598,15 @@ describe('Input', () => {
|
|
|
598
598
|
jsxElement: <Input name="field" getEndIcon={getEndIcon} />,
|
|
599
599
|
})
|
|
600
600
|
|
|
601
|
-
await
|
|
601
|
+
await flushUpdates()
|
|
602
602
|
|
|
603
603
|
const input = document.querySelector('shade-input input') as HTMLInputElement
|
|
604
604
|
|
|
605
605
|
input.dispatchEvent(new FocusEvent('focus'))
|
|
606
|
-
await
|
|
606
|
+
await flushUpdates()
|
|
607
607
|
|
|
608
608
|
input.dispatchEvent(new FocusEvent('blur'))
|
|
609
|
-
await
|
|
609
|
+
await flushUpdates()
|
|
610
610
|
|
|
611
611
|
expect(getEndIcon).toHaveBeenLastCalledWith(
|
|
612
612
|
expect.objectContaining({
|
|
@@ -631,7 +631,7 @@ describe('Input', () => {
|
|
|
631
631
|
jsxElement: <Input name="field" autofocus getEndIcon={getEndIcon} />,
|
|
632
632
|
})
|
|
633
633
|
|
|
634
|
-
await
|
|
634
|
+
await flushUpdates()
|
|
635
635
|
|
|
636
636
|
expect(getEndIcon).toHaveBeenCalledWith(
|
|
637
637
|
expect.objectContaining({
|
|
@@ -661,7 +661,7 @@ describe('Input', () => {
|
|
|
661
661
|
),
|
|
662
662
|
})
|
|
663
663
|
|
|
664
|
-
await
|
|
664
|
+
await flushUpdates()
|
|
665
665
|
|
|
666
666
|
const form = document.querySelector('form[is="shade-form"]') as HTMLFormElement
|
|
667
667
|
const formInjector = (form as unknown as { injector: Injector }).injector
|
|
@@ -696,7 +696,7 @@ describe('Input', () => {
|
|
|
696
696
|
),
|
|
697
697
|
})
|
|
698
698
|
|
|
699
|
-
await
|
|
699
|
+
await flushUpdates()
|
|
700
700
|
|
|
701
701
|
const form = document.querySelector('form[is="shade-form"]') as HTMLFormElement
|
|
702
702
|
const inputWrapper = form.querySelector('shade-input') as HTMLElement
|
|
@@ -705,7 +705,7 @@ describe('Input', () => {
|
|
|
705
705
|
input.value = 'invalid'
|
|
706
706
|
input.dispatchEvent(new Event('change', { bubbles: true }))
|
|
707
707
|
|
|
708
|
-
await
|
|
708
|
+
await flushUpdates()
|
|
709
709
|
|
|
710
710
|
const formInjector = (form as unknown as { injector: Injector }).injector
|
|
711
711
|
const formService = formInjector.getInstance(FormService)
|
|
@@ -735,7 +735,7 @@ describe('Input', () => {
|
|
|
735
735
|
),
|
|
736
736
|
})
|
|
737
737
|
|
|
738
|
-
await
|
|
738
|
+
await flushUpdates()
|
|
739
739
|
|
|
740
740
|
const form = document.querySelector('form[is="shade-form"]') as HTMLFormElement
|
|
741
741
|
const formInjector = (form as unknown as { injector: Injector }).injector
|
|
@@ -745,7 +745,7 @@ describe('Input', () => {
|
|
|
745
745
|
|
|
746
746
|
rootElement.innerHTML = ''
|
|
747
747
|
|
|
748
|
-
await
|
|
748
|
+
await flushUpdates()
|
|
749
749
|
})
|
|
750
750
|
})
|
|
751
751
|
})
|
|
@@ -761,7 +761,7 @@ describe('Input', () => {
|
|
|
761
761
|
jsxElement: <Input name="email" type="email" />,
|
|
762
762
|
})
|
|
763
763
|
|
|
764
|
-
await
|
|
764
|
+
await flushUpdates()
|
|
765
765
|
|
|
766
766
|
const inputWrapper = document.querySelector('shade-input') as HTMLElement
|
|
767
767
|
const input = inputWrapper.querySelector('input') as HTMLInputElement
|
|
@@ -770,7 +770,7 @@ describe('Input', () => {
|
|
|
770
770
|
const invalidEvent = new Event('invalid', { bubbles: true, cancelable: true })
|
|
771
771
|
input.dispatchEvent(invalidEvent)
|
|
772
772
|
|
|
773
|
-
await
|
|
773
|
+
await flushUpdates()
|
|
774
774
|
|
|
775
775
|
const helperText = inputWrapper.querySelector('.helperText') as HTMLElement
|
|
776
776
|
expect(helperText.textContent).toBe('Value is not valid')
|
|
@@ -787,7 +787,7 @@ describe('Input', () => {
|
|
|
787
787
|
jsxElement: <Input name="code" pattern="[A-Z]{3}" />,
|
|
788
788
|
})
|
|
789
789
|
|
|
790
|
-
await
|
|
790
|
+
await flushUpdates()
|
|
791
791
|
|
|
792
792
|
const inputWrapper = document.querySelector('shade-input') as HTMLElement
|
|
793
793
|
const input = inputWrapper.querySelector('input') as HTMLInputElement
|
|
@@ -796,7 +796,7 @@ describe('Input', () => {
|
|
|
796
796
|
const invalidEvent = new Event('invalid', { bubbles: true, cancelable: true })
|
|
797
797
|
input.dispatchEvent(invalidEvent)
|
|
798
798
|
|
|
799
|
-
await
|
|
799
|
+
await flushUpdates()
|
|
800
800
|
|
|
801
801
|
const helperText = inputWrapper.querySelector('.helperText') as HTMLElement
|
|
802
802
|
expect(helperText.textContent).toBe('Value does not match the pattern')
|
|
@@ -815,7 +815,7 @@ describe('Input', () => {
|
|
|
815
815
|
jsxElement: <Input name="field" value="initial value" />,
|
|
816
816
|
})
|
|
817
817
|
|
|
818
|
-
await
|
|
818
|
+
await flushUpdates()
|
|
819
819
|
|
|
820
820
|
const input = document.querySelector('shade-input input') as HTMLInputElement
|
|
821
821
|
expect(input.value).toBe('initial value')
|
|
@@ -834,7 +834,7 @@ describe('Input', () => {
|
|
|
834
834
|
jsxElement: <Input name="field" labelProps={{ className: 'custom-label' }} />,
|
|
835
835
|
})
|
|
836
836
|
|
|
837
|
-
await
|
|
837
|
+
await flushUpdates()
|
|
838
838
|
|
|
839
839
|
const label = document.querySelector('shade-input label') as HTMLLabelElement
|
|
840
840
|
expect(label.className).toContain('custom-label')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Injector } from '@furystack/inject'
|
|
2
|
-
import { createComponent, initializeShadeRoot } from '@furystack/shades'
|
|
3
|
-
import {
|
|
2
|
+
import { createComponent, flushUpdates, initializeShadeRoot } from '@furystack/shades'
|
|
3
|
+
import { usingAsync } from '@furystack/utils'
|
|
4
4
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
|
5
5
|
import { RadioGroup } from './radio-group.js'
|
|
6
6
|
import { Radio } from './radio.js'
|
|
@@ -30,7 +30,7 @@ describe('RadioGroup', () => {
|
|
|
30
30
|
),
|
|
31
31
|
})
|
|
32
32
|
|
|
33
|
-
await
|
|
33
|
+
await flushUpdates()
|
|
34
34
|
|
|
35
35
|
const group = document.querySelector('shade-radio-group')
|
|
36
36
|
expect(group).not.toBeNull()
|
|
@@ -51,7 +51,7 @@ describe('RadioGroup', () => {
|
|
|
51
51
|
),
|
|
52
52
|
})
|
|
53
53
|
|
|
54
|
-
await
|
|
54
|
+
await flushUpdates()
|
|
55
55
|
|
|
56
56
|
const group = document.querySelector('shade-radio-group') as HTMLElement
|
|
57
57
|
expect(group.getAttribute('role')).toBe('radiogroup')
|
|
@@ -72,7 +72,7 @@ describe('RadioGroup', () => {
|
|
|
72
72
|
),
|
|
73
73
|
})
|
|
74
74
|
|
|
75
|
-
await
|
|
75
|
+
await flushUpdates()
|
|
76
76
|
|
|
77
77
|
const label = document.querySelector('shade-radio-group .radio-group-label') as HTMLElement
|
|
78
78
|
expect(label).not.toBeNull()
|
|
@@ -94,7 +94,7 @@ describe('RadioGroup', () => {
|
|
|
94
94
|
),
|
|
95
95
|
})
|
|
96
96
|
|
|
97
|
-
await
|
|
97
|
+
await flushUpdates()
|
|
98
98
|
|
|
99
99
|
const label = document.querySelector('shade-radio-group .radio-group-label')
|
|
100
100
|
expect(label).toBeNull()
|
|
@@ -116,7 +116,7 @@ describe('RadioGroup', () => {
|
|
|
116
116
|
),
|
|
117
117
|
})
|
|
118
118
|
|
|
119
|
-
await
|
|
119
|
+
await flushUpdates()
|
|
120
120
|
|
|
121
121
|
const group = document.querySelector('shade-radio-group') as HTMLElement
|
|
122
122
|
expect(group.getAttribute('data-orientation')).toBe('vertical')
|
|
@@ -137,7 +137,7 @@ describe('RadioGroup', () => {
|
|
|
137
137
|
),
|
|
138
138
|
})
|
|
139
139
|
|
|
140
|
-
await
|
|
140
|
+
await flushUpdates()
|
|
141
141
|
|
|
142
142
|
const group = document.querySelector('shade-radio-group') as HTMLElement
|
|
143
143
|
expect(group.getAttribute('data-orientation')).toBe('horizontal')
|
|
@@ -161,7 +161,7 @@ describe('RadioGroup', () => {
|
|
|
161
161
|
),
|
|
162
162
|
})
|
|
163
163
|
|
|
164
|
-
await
|
|
164
|
+
await flushUpdates()
|
|
165
165
|
|
|
166
166
|
const inputs = document.querySelectorAll('shade-radio input[type="radio"]')
|
|
167
167
|
inputs.forEach((input) => {
|
|
@@ -188,7 +188,7 @@ describe('RadioGroup', () => {
|
|
|
188
188
|
),
|
|
189
189
|
})
|
|
190
190
|
|
|
191
|
-
await
|
|
191
|
+
await flushUpdates()
|
|
192
192
|
|
|
193
193
|
const inputs = document.querySelectorAll('shade-radio input[type="radio"]')
|
|
194
194
|
expect((inputs[0] as HTMLInputElement).checked).toBe(false)
|
|
@@ -213,7 +213,7 @@ describe('RadioGroup', () => {
|
|
|
213
213
|
),
|
|
214
214
|
})
|
|
215
215
|
|
|
216
|
-
await
|
|
216
|
+
await flushUpdates()
|
|
217
217
|
|
|
218
218
|
const inputs = document.querySelectorAll('shade-radio input[type="radio"]')
|
|
219
219
|
expect((inputs[0] as HTMLInputElement).checked).toBe(false)
|
|
@@ -239,7 +239,7 @@ describe('RadioGroup', () => {
|
|
|
239
239
|
),
|
|
240
240
|
})
|
|
241
241
|
|
|
242
|
-
await
|
|
242
|
+
await flushUpdates()
|
|
243
243
|
|
|
244
244
|
const inputs = document.querySelectorAll('shade-radio input[type="radio"]')
|
|
245
245
|
inputs.forEach((input) => {
|
|
@@ -266,13 +266,13 @@ describe('RadioGroup', () => {
|
|
|
266
266
|
),
|
|
267
267
|
})
|
|
268
268
|
|
|
269
|
-
await
|
|
269
|
+
await flushUpdates()
|
|
270
270
|
|
|
271
271
|
const input = document.querySelectorAll('shade-radio input[type="radio"]')[1] as HTMLInputElement
|
|
272
272
|
input.checked = true
|
|
273
273
|
input.dispatchEvent(new Event('change', { bubbles: true }))
|
|
274
274
|
|
|
275
|
-
await
|
|
275
|
+
await flushUpdates()
|
|
276
276
|
|
|
277
277
|
expect(onchange).toHaveBeenCalledWith('option2')
|
|
278
278
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Injector } from '@furystack/inject'
|
|
2
|
-
import { createComponent, initializeShadeRoot } from '@furystack/shades'
|
|
3
|
-
import {
|
|
2
|
+
import { createComponent, flushUpdates, initializeShadeRoot } from '@furystack/shades'
|
|
3
|
+
import { usingAsync } from '@furystack/utils'
|
|
4
4
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
|
5
5
|
import { ThemeProviderService } from '../../services/theme-provider-service.js'
|
|
6
6
|
import { Form, FormService } from '../form.js'
|
|
@@ -26,7 +26,7 @@ describe('Radio', () => {
|
|
|
26
26
|
jsxElement: <Radio value="option1" />,
|
|
27
27
|
})
|
|
28
28
|
|
|
29
|
-
await
|
|
29
|
+
await flushUpdates()
|
|
30
30
|
|
|
31
31
|
const radio = document.querySelector('shade-radio')
|
|
32
32
|
expect(radio).not.toBeNull()
|
|
@@ -43,7 +43,7 @@ describe('Radio', () => {
|
|
|
43
43
|
jsxElement: <Radio value="option1" name="test-group" />,
|
|
44
44
|
})
|
|
45
45
|
|
|
46
|
-
await
|
|
46
|
+
await flushUpdates()
|
|
47
47
|
|
|
48
48
|
const input = document.querySelector('shade-radio input[type="radio"]') as HTMLInputElement
|
|
49
49
|
expect(input).not.toBeNull()
|
|
@@ -62,7 +62,7 @@ describe('Radio', () => {
|
|
|
62
62
|
jsxElement: <Radio value="option1" labelTitle="Option 1" />,
|
|
63
63
|
})
|
|
64
64
|
|
|
65
|
-
await
|
|
65
|
+
await flushUpdates()
|
|
66
66
|
|
|
67
67
|
const label = document.querySelector('shade-radio label') as HTMLLabelElement
|
|
68
68
|
expect(label).not.toBeNull()
|
|
@@ -80,7 +80,7 @@ describe('Radio', () => {
|
|
|
80
80
|
jsxElement: <Radio value="option1" />,
|
|
81
81
|
})
|
|
82
82
|
|
|
83
|
-
await
|
|
83
|
+
await flushUpdates()
|
|
84
84
|
|
|
85
85
|
const labelSpan = document.querySelector('shade-radio .radio-label')
|
|
86
86
|
expect(labelSpan).toBeNull()
|
|
@@ -98,7 +98,7 @@ describe('Radio', () => {
|
|
|
98
98
|
jsxElement: <Radio value="option1" checked />,
|
|
99
99
|
})
|
|
100
100
|
|
|
101
|
-
await
|
|
101
|
+
await flushUpdates()
|
|
102
102
|
|
|
103
103
|
const input = document.querySelector('shade-radio input[type="radio"]') as HTMLInputElement
|
|
104
104
|
expect(input.checked).toBe(true)
|
|
@@ -115,7 +115,7 @@ describe('Radio', () => {
|
|
|
115
115
|
jsxElement: <Radio value="option1" checked={false} />,
|
|
116
116
|
})
|
|
117
117
|
|
|
118
|
-
await
|
|
118
|
+
await flushUpdates()
|
|
119
119
|
|
|
120
120
|
const input = document.querySelector('shade-radio input[type="radio"]') as HTMLInputElement
|
|
121
121
|
expect(input.checked).toBe(false)
|
|
@@ -134,7 +134,7 @@ describe('Radio', () => {
|
|
|
134
134
|
jsxElement: <Radio value="option1" disabled />,
|
|
135
135
|
})
|
|
136
136
|
|
|
137
|
-
await
|
|
137
|
+
await flushUpdates()
|
|
138
138
|
|
|
139
139
|
const radio = document.querySelector('shade-radio') as HTMLElement
|
|
140
140
|
expect(radio.hasAttribute('data-disabled')).toBe(true)
|
|
@@ -154,7 +154,7 @@ describe('Radio', () => {
|
|
|
154
154
|
jsxElement: <Radio value="option1" disabled={false} />,
|
|
155
155
|
})
|
|
156
156
|
|
|
157
|
-
await
|
|
157
|
+
await flushUpdates()
|
|
158
158
|
|
|
159
159
|
const radio = document.querySelector('shade-radio') as HTMLElement
|
|
160
160
|
expect(radio.hasAttribute('data-disabled')).toBe(false)
|
|
@@ -173,7 +173,7 @@ describe('Radio', () => {
|
|
|
173
173
|
jsxElement: <Radio value="option1" />,
|
|
174
174
|
})
|
|
175
175
|
|
|
176
|
-
await
|
|
176
|
+
await flushUpdates()
|
|
177
177
|
|
|
178
178
|
const radio = document.querySelector('shade-radio') as HTMLElement
|
|
179
179
|
const themeService = injector.getInstance(ThemeProviderService)
|
|
@@ -191,7 +191,7 @@ describe('Radio', () => {
|
|
|
191
191
|
jsxElement: <Radio value="option1" color="secondary" />,
|
|
192
192
|
})
|
|
193
193
|
|
|
194
|
-
await
|
|
194
|
+
await flushUpdates()
|
|
195
195
|
|
|
196
196
|
const radio = document.querySelector('shade-radio') as HTMLElement
|
|
197
197
|
const themeService = injector.getInstance(ThemeProviderService)
|
|
@@ -212,12 +212,12 @@ describe('Radio', () => {
|
|
|
212
212
|
jsxElement: <Radio value="option1" name="test" onchange={onchange} />,
|
|
213
213
|
})
|
|
214
214
|
|
|
215
|
-
await
|
|
215
|
+
await flushUpdates()
|
|
216
216
|
|
|
217
217
|
const input = document.querySelector('shade-radio input[type="radio"]') as HTMLInputElement
|
|
218
218
|
input.dispatchEvent(new Event('change', { bubbles: true }))
|
|
219
219
|
|
|
220
|
-
await
|
|
220
|
+
await flushUpdates()
|
|
221
221
|
|
|
222
222
|
expect(onchange).toHaveBeenCalled()
|
|
223
223
|
})
|
|
@@ -241,7 +241,7 @@ describe('Radio', () => {
|
|
|
241
241
|
),
|
|
242
242
|
})
|
|
243
243
|
|
|
244
|
-
await
|
|
244
|
+
await flushUpdates()
|
|
245
245
|
|
|
246
246
|
const form = document.querySelector('form[is="shade-form"]') as HTMLFormElement
|
|
247
247
|
const formInjector = (form as unknown as { injector: Injector }).injector
|
|
@@ -263,7 +263,7 @@ describe('Radio', () => {
|
|
|
263
263
|
jsxElement: <Radio value="option1" labelProps={{ className: 'custom-label' }} />,
|
|
264
264
|
})
|
|
265
265
|
|
|
266
|
-
await
|
|
266
|
+
await flushUpdates()
|
|
267
267
|
|
|
268
268
|
const label = document.querySelector('shade-radio label') as HTMLLabelElement
|
|
269
269
|
expect(label.className).toContain('custom-label')
|