Skip to content

Commit f35df51

Browse files
committed
fix Combobox test so it properly catches previous Document bug
tested with the Document changes removed and verified that the test fails properly. Swore it failed when I first wrote it...
1 parent fb0aff3 commit f35df51

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/@react-spectrum/s2/test/Combobox.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ describe('Combobox', () => {
3939
jest.useFakeTimers();
4040
jest.spyOn(window.HTMLElement.prototype, 'clientWidth', 'get').mockImplementation(() => 100);
4141
jest.spyOn(window.HTMLElement.prototype, 'clientHeight', 'get').mockImplementation(() => 100);
42+
jest.spyOn(window.HTMLElement.prototype, 'scrollHeight', 'get').mockImplementation(() => 50);
4243
user = userEvent.setup({delay: null, pointerMap});
4344
});
4445

@@ -154,7 +155,7 @@ describe('Combobox', () => {
154155
}
155156

156157
// A bit contrived, but essentially testing a combinaiton of insertions/deletions along side some of the old entries remaining
157-
let newItems = [{name: 'Chocolate Mint'}, {name: 'Chocolate'}, {name: 'Chocolate Chip'}, {name: 'Chocolate Chip Cookie Dough'}];
158+
let newItems = [{name: 'Chocolate'}, {name: 'Chocolate Mint'}, {name: 'Chocolate Chip Cookie Dough'}, {name: 'Chocolate Chip'}];
158159
tree.rerender(<DynamicCombobox items={newItems} loadingState="idle" />);
159160

160161
options = comboboxTester.options();

0 commit comments

Comments
 (0)