Skip to content

Commit 652bad8

Browse files
committed
test: add missing test for suggestions
1 parent d1ff495 commit 652bad8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/__tests__/suggestions.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,16 @@ test('should not suggest when suggest is turned off for a query', () => {
103103
).not.toThrowError()
104104
})
105105

106+
test('should suggest when suggest is turned on for a specific query but disabled in config', () => {
107+
configure({throwSuggestions: false})
108+
renderIntoDocument(`
109+
<button data-testid="foo">submit</button>
110+
<button data-testid="foot">another</button>`)
111+
112+
expect(() => screen.getByTestId('foo', {suggest: true})).toThrowError()
113+
configure({throwSuggestions: true})
114+
})
115+
106116
test('should suggest getByRole when used with getBy', () => {
107117
renderIntoDocument(`<button data-testid="foo">submit</button>`)
108118

0 commit comments

Comments
 (0)