Skip to content

Commit 2cb9ad2

Browse files
committed
test: fix test
1 parent 8234174 commit 2cb9ad2

File tree

3 files changed

+27
-291
lines changed

3 files changed

+27
-291
lines changed

tests/__snapshots__/Combobox.test.tsx.snap

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
exports[`Select.Combobox renders controlled correctly 1`] = `
44
<div
5-
class="rc-select rc-select-single rc-select-show-search"
5+
class="rc-select rc-select-single"
66
>
77
<div
88
class="rc-select-content"
@@ -14,7 +14,17 @@ exports[`Select.Combobox renders controlled correctly 1`] = `
1414
Search
1515
</div>
1616
<input
17+
aria-autocomplete="list"
18+
aria-controls="test-id_list"
19+
aria-expanded="false"
20+
aria-haspopup="listbox"
21+
aria-owns="test-id_list"
22+
autocomplete="off"
1723
class="rc-select-input"
24+
id="test-id"
25+
readonly=""
26+
role="combobox"
27+
type="text"
1828
value=""
1929
/>
2030
</div>
@@ -23,7 +33,7 @@ exports[`Select.Combobox renders controlled correctly 1`] = `
2333

2434
exports[`Select.Combobox renders correctly 1`] = `
2535
<div
26-
class="rc-select rc-select-single rc-select-show-search"
36+
class="rc-select rc-select-single"
2737
>
2838
<div
2939
class="rc-select-content"
@@ -35,7 +45,17 @@ exports[`Select.Combobox renders correctly 1`] = `
3545
Search
3646
</div>
3747
<input
48+
aria-autocomplete="list"
49+
aria-controls="test-id_list"
50+
aria-expanded="false"
51+
aria-haspopup="listbox"
52+
aria-owns="test-id_list"
53+
autocomplete="off"
3854
class="rc-select-input"
55+
id="test-id"
56+
readonly=""
57+
role="combobox"
58+
type="text"
3959
value=""
4060
/>
4161
</div>

tests/__snapshots__/Tags.test.tsx.snap

Lines changed: 4 additions & 288 deletions
Original file line numberDiff line numberDiff line change
@@ -203,293 +203,9 @@ exports[`Select.Tags OptGroup renders correctly 1`] = `
203203
</div>
204204
`;
205205

206-
exports[`Select.Tags max tag render not display maxTagPlaceholder if maxTagCount not reach 1`] = `
207-
<div
208-
class="rc-select rc-select-multiple rc-select-show-search"
209-
>
210-
<div
211-
class="rc-select-content"
212-
>
213-
<div
214-
class="rc-select-content-item rc-select-content-item-suffix"
215-
style="opacity: 1;"
216-
>
217-
<input
218-
aria-autocomplete="list"
219-
aria-controls="test-id_list"
220-
aria-expanded="false"
221-
aria-haspopup="listbox"
222-
aria-owns="test-id_list"
223-
autocomplete="off"
224-
class="rc-select-input"
225-
id="test-id"
226-
role="combobox"
227-
style="--select-input-width: 0;"
228-
type="search"
229-
value=""
230-
/>
231-
</div>
232-
</div>
233-
</div>
234-
`;
235-
236-
exports[`Select.Tags max tag render truncates tags by maxTagCount and show maxTagPlaceholder 1`] = `
237-
<div
238-
class="rc-select rc-select-multiple rc-select-show-search"
239-
>
240-
<div
241-
class="rc-select-content"
242-
>
243-
<div
244-
class="rc-select-content-item"
245-
style="opacity: 1;"
246-
>
247-
<span
248-
class="rc-select-selection-item"
249-
title="One"
250-
>
251-
<span
252-
class="rc-select-selection-item-content"
253-
>
254-
One
255-
</span>
256-
<span
257-
aria-hidden="true"
258-
class="rc-select-selection-item-remove"
259-
style="user-select: none;"
260-
unselectable="on"
261-
>
262-
×
263-
</span>
264-
</span>
265-
</div>
266-
<div
267-
class="rc-select-content-item"
268-
style="opacity: 1;"
269-
>
270-
<span
271-
class="rc-select-selection-item"
272-
title="Two"
273-
>
274-
<span
275-
class="rc-select-selection-item-content"
276-
>
277-
Two
278-
</span>
279-
<span
280-
aria-hidden="true"
281-
class="rc-select-selection-item-remove"
282-
style="user-select: none;"
283-
unselectable="on"
284-
>
285-
×
286-
</span>
287-
</span>
288-
</div>
289-
<div
290-
class="rc-select-content-item rc-select-content-item-rest"
291-
style="opacity: 1;"
292-
>
293-
<span
294-
class="rc-select-selection-item"
295-
>
296-
<span
297-
class="rc-select-selection-item-content"
298-
>
299-
<span>
300-
Omitted
301-
</span>
302-
</span>
303-
</span>
304-
</div>
305-
<div
306-
class="rc-select-content-item rc-select-content-item-suffix"
307-
style="opacity: 1;"
308-
>
309-
<input
310-
aria-autocomplete="list"
311-
aria-controls="test-id_list"
312-
aria-expanded="false"
313-
aria-haspopup="listbox"
314-
aria-owns="test-id_list"
315-
autocomplete="off"
316-
class="rc-select-input"
317-
id="test-id"
318-
role="combobox"
319-
style="--select-input-width: 0;"
320-
type="search"
321-
value=""
322-
/>
323-
</div>
324-
</div>
325-
</div>
326-
`;
327-
328-
exports[`Select.Tags max tag render truncates tags by maxTagCount and show maxTagPlaceholder function 1`] = `
329-
<div
330-
class="rc-select rc-select-multiple rc-select-show-search"
331-
>
332-
<div
333-
class="rc-select-content"
334-
>
335-
<div
336-
class="rc-select-content-item"
337-
style="opacity: 1;"
338-
>
339-
<span
340-
class="rc-select-selection-item"
341-
title="One"
342-
>
343-
<span
344-
class="rc-select-selection-item-content"
345-
>
346-
One
347-
</span>
348-
<span
349-
aria-hidden="true"
350-
class="rc-select-selection-item-remove"
351-
style="user-select: none;"
352-
unselectable="on"
353-
>
354-
×
355-
</span>
356-
</span>
357-
</div>
358-
<div
359-
class="rc-select-content-item"
360-
style="opacity: 1;"
361-
>
362-
<span
363-
class="rc-select-selection-item"
364-
title="Two"
365-
>
366-
<span
367-
class="rc-select-selection-item-content"
368-
>
369-
Two
370-
</span>
371-
<span
372-
aria-hidden="true"
373-
class="rc-select-selection-item-remove"
374-
style="user-select: none;"
375-
unselectable="on"
376-
>
377-
×
378-
</span>
379-
</span>
380-
</div>
381-
<div
382-
class="rc-select-content-item rc-select-content-item-rest"
383-
style="opacity: 1;"
384-
>
385-
<span
386-
class="rc-select-selection-item"
387-
>
388-
<span
389-
class="rc-select-selection-item-content"
390-
>
391-
<span>
392-
1
393-
values omitted
394-
</span>
395-
</span>
396-
</span>
397-
</div>
398-
<div
399-
class="rc-select-content-item rc-select-content-item-suffix"
400-
style="opacity: 1;"
401-
>
402-
<input
403-
aria-autocomplete="list"
404-
aria-controls="test-id_list"
405-
aria-expanded="false"
406-
aria-haspopup="listbox"
407-
aria-owns="test-id_list"
408-
autocomplete="off"
409-
class="rc-select-input"
410-
id="test-id"
411-
role="combobox"
412-
style="--select-input-width: 0;"
413-
type="search"
414-
value=""
415-
/>
416-
</div>
417-
</div>
418-
</div>
419-
`;
420-
421206
exports[`Select.Tags max tag render truncates values by maxTagTextLength 1`] = `
422-
<div
423-
class="rc-select rc-select-multiple rc-select-show-search"
424-
>
425-
<div
426-
class="rc-select-content"
427-
>
428-
<div
429-
class="rc-select-content-item"
430-
style="opacity: 1;"
431-
>
432-
<span
433-
class="rc-select-selection-item"
434-
title="One"
435-
>
436-
<span
437-
class="rc-select-selection-item-content"
438-
>
439-
On...
440-
</span>
441-
<span
442-
aria-hidden="true"
443-
class="rc-select-selection-item-remove"
444-
style="user-select: none;"
445-
unselectable="on"
446-
>
447-
×
448-
</span>
449-
</span>
450-
</div>
451-
<div
452-
class="rc-select-content-item"
453-
style="opacity: 1;"
454-
>
455-
<span
456-
class="rc-select-selection-item"
457-
title="Two"
458-
>
459-
<span
460-
class="rc-select-selection-item-content"
461-
>
462-
Tw...
463-
</span>
464-
<span
465-
aria-hidden="true"
466-
class="rc-select-selection-item-remove"
467-
style="user-select: none;"
468-
unselectable="on"
469-
>
470-
×
471-
</span>
472-
</span>
473-
</div>
474-
<div
475-
class="rc-select-content-item rc-select-content-item-suffix"
476-
style="opacity: 1;"
477-
>
478-
<input
479-
aria-autocomplete="list"
480-
aria-controls="test-id_list"
481-
aria-expanded="false"
482-
aria-haspopup="listbox"
483-
aria-owns="test-id_list"
484-
autocomplete="off"
485-
class="rc-select-input"
486-
id="test-id"
487-
role="combobox"
488-
style="--select-input-width: 0;"
489-
type="search"
490-
value=""
491-
/>
492-
</div>
493-
</div>
494-
</div>
207+
[
208+
"On...",
209+
"Tw...",
210+
]
495211
`;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`Select.SSR should work 1`] = `"<div class="rc-select rc-select-single"><div class="rc-select-selector"><span class="rc-select-selection-wrap"><span class="rc-select-selection-search"><input type="search" id="test-id" autoComplete="off" class="rc-select-selection-search-input" role="combobox" aria-expanded="false" aria-haspopup="listbox" aria-owns="test-id_list" aria-autocomplete="list" aria-controls="test-id_list" readonly="" unselectable="on" style="opacity:0" value=""/></span><span class="rc-select-selection-placeholder"></span></span></div></div>"`;
3+
exports[`Select.SSR should work 1`] = `"<div class="rc-select rc-select-single"><div class="rc-select-content"><div class="rc-select-placeholder" style="visibility:visible"></div><input id="test-id" type="search" readonly="" autoComplete="off" class="rc-select-input" role="combobox" aria-expanded="false" aria-haspopup="listbox" aria-owns="test-id_list" aria-autocomplete="list" aria-controls="test-id_list" value=""/></div></div>"`;

0 commit comments

Comments
 (0)