@@ -112,7 +112,7 @@ describe("calcite-color-picker-hex-input", () => {
112
112
113
113
it ( "commits shorthand hex on blur" , async ( ) => {
114
114
const defaultHex = "#b33f33" ;
115
- const editedHex = "#aabbcc" ;
115
+ const expandedHex = "#aabbcc" ;
116
116
const page = await newE2EPage ( ) ;
117
117
await page . setContent ( `<calcite-color-picker-hex-input value='${ defaultHex } '></calcite-color-picker-hex-input>` ) ;
118
118
@@ -129,45 +129,53 @@ describe("calcite-color-picker-hex-input", () => {
129
129
await page . keyboard . press ( "Tab" ) ;
130
130
await page . waitForChanges ( ) ;
131
131
132
- expect ( await input . getProperty ( "value" ) ) . toBe ( editedHex ) ;
132
+ expect ( await input . getProperty ( "value" ) ) . toBe ( expandedHex ) ;
133
133
134
134
await selectText ( input ) ;
135
135
await page . keyboard . type ( "abcd" ) ;
136
136
await page . keyboard . press ( "Tab" ) ;
137
137
await page . waitForChanges ( ) ;
138
138
139
- expect ( await input . getProperty ( "value" ) ) . toBe ( editedHex ) ;
139
+ expect ( await input . getProperty ( "value" ) ) . toBe ( expandedHex ) ;
140
140
} ) ;
141
141
142
- it ( "commits shorthand hexa on blur" , async ( ) => {
142
+ it ( "commits shorthand hex and hexa on blur" , async ( ) => {
143
143
const defaultHexa = "#b33f33ff" ;
144
- const editedHexa = "#aabbccdd" ;
144
+ const expandedHexa = "#aabbccdd" ;
145
+ const expandedHex = "#aabbccff" ;
145
146
const page = await newE2EPage ( ) ;
146
147
await page . setContent (
147
148
`<calcite-color-picker-hex-input alpha-channel value='${ defaultHexa } '></calcite-color-picker-hex-input>` ,
148
149
) ;
149
150
150
151
const input = await page . find ( `calcite-color-picker-hex-input` ) ;
151
152
await selectText ( input ) ;
152
- await page . keyboard . type ( "abc " ) ;
153
+ await page . keyboard . type ( "ab " ) ;
153
154
await page . keyboard . press ( "Tab" ) ;
154
155
await page . waitForChanges ( ) ;
155
156
156
157
expect ( await input . getProperty ( "value" ) ) . toBe ( defaultHexa ) ;
157
158
159
+ await selectText ( input ) ;
160
+ await page . keyboard . type ( "abc" ) ;
161
+ await page . keyboard . press ( "Tab" ) ;
162
+ await page . waitForChanges ( ) ;
163
+
164
+ expect ( await input . getProperty ( "value" ) ) . toBe ( expandedHex ) ;
165
+
158
166
await selectText ( input ) ;
159
167
await page . keyboard . type ( "abcd" ) ;
160
168
await page . keyboard . press ( "Tab" ) ;
161
169
await page . waitForChanges ( ) ;
162
170
163
- expect ( await input . getProperty ( "value" ) ) . toBe ( editedHexa ) ;
171
+ expect ( await input . getProperty ( "value" ) ) . toBe ( expandedHexa ) ;
164
172
165
173
await selectText ( input ) ;
166
174
await page . keyboard . type ( "abcde" ) ;
167
175
await page . keyboard . press ( "Tab" ) ;
168
176
await page . waitForChanges ( ) ;
169
177
170
- expect ( await input . getProperty ( "value" ) ) . toBe ( editedHexa ) ;
178
+ expect ( await input . getProperty ( "value" ) ) . toBe ( expandedHexa ) ;
171
179
} ) ;
172
180
173
181
it ( "normalizes value when initialized" , async ( ) => {
0 commit comments