|
1 | 1 | import {Component, computed, DebugElement, signal} from '@angular/core'; |
2 | 2 | import {ComponentFixture, TestBed} from '@angular/core/testing'; |
3 | 3 | import {By} from '@angular/platform-browser'; |
4 | | -import {Combobox, ComboboxInput, ComboboxPopup, ComboboxPopupContainer} from '../combobox'; |
| 4 | +import { |
| 5 | + Combobox, |
| 6 | + ComboboxInput, |
| 7 | + ComboboxPopup, |
| 8 | + ComboboxFilterMode, |
| 9 | + ComboboxPopupContainer, |
| 10 | +} from '../combobox'; |
5 | 11 | import {Listbox, Option} from '../listbox'; |
6 | 12 | import {runAccessibilityChecks} from '@angular/cdk/testing/private'; |
7 | 13 | import {Tree, TreeItem, TreeItemGroup} from '../tree'; |
@@ -52,9 +58,7 @@ describe('Combobox', () => { |
52 | 58 | const enter = (modifierKeys?: {}) => keydown('Enter', modifierKeys); |
53 | 59 | const escape = (modifierKeys?: {}) => keydown('Escape', modifierKeys); |
54 | 60 |
|
55 | | - function setupCombobox( |
56 | | - opts: {readonly?: boolean; filterMode?: 'manual' | 'auto-select' | 'highlight'} = {}, |
57 | | - ) { |
| 61 | + function setupCombobox(opts: {readonly?: boolean; filterMode?: ComboboxFilterMode} = {}) { |
58 | 62 | TestBed.configureTestingModule({}); |
59 | 63 | fixture = TestBed.createComponent(ComboboxListboxExample); |
60 | 64 | const testComponent = fixture.componentInstance; |
@@ -605,9 +609,7 @@ describe('Combobox', () => { |
605 | 609 | const enter = (modifierKeys?: {}) => keydown('Enter', modifierKeys); |
606 | 610 | const escape = (modifierKeys?: {}) => keydown('Escape', modifierKeys); |
607 | 611 |
|
608 | | - function setupCombobox( |
609 | | - opts: {readonly?: boolean; filterMode?: 'manual' | 'auto-select' | 'highlight'} = {}, |
610 | | - ) { |
| 612 | + function setupCombobox(opts: {readonly?: boolean; filterMode?: ComboboxFilterMode} = {}) { |
611 | 613 | TestBed.configureTestingModule({}); |
612 | 614 | fixture = TestBed.createComponent(ComboboxTreeExample); |
613 | 615 | const testComponent = fixture.componentInstance; |
@@ -1126,7 +1128,7 @@ class ComboboxListboxExample { |
1126 | 1128 | readonly = signal(false); |
1127 | 1129 | searchString = signal(''); |
1128 | 1130 | values = signal<string[]>([]); |
1129 | | - filterMode = signal<'manual' | 'auto-select' | 'highlight'>('manual'); |
| 1131 | + filterMode = signal<ComboboxFilterMode>('manual'); |
1130 | 1132 |
|
1131 | 1133 | options = computed(() => |
1132 | 1134 | states.filter(state => state.toLowerCase().startsWith(this.searchString().toLowerCase())), |
@@ -1197,7 +1199,7 @@ class ComboboxTreeExample { |
1197 | 1199 | searchString = signal(''); |
1198 | 1200 | values = signal<string[]>([]); |
1199 | 1201 | nodes = computed(() => this.filterTreeNodes(TREE_NODES)); |
1200 | | - filterMode = signal<'manual' | 'auto-select' | 'highlight'>('manual'); |
| 1202 | + filterMode = signal<ComboboxFilterMode>('manual'); |
1201 | 1203 |
|
1202 | 1204 | firstMatch = computed<string | undefined>(() => { |
1203 | 1205 | const flatNodes = this.flattenTreeNodes(this.nodes()); |
|
0 commit comments