Skip to content

Commit 161b5fe

Browse files
test: add todos
1 parent efa4c93 commit 161b5fe

File tree

5 files changed

+46
-2
lines changed

5 files changed

+46
-2
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
describe('getHTMLElement', () => {
2+
test.todo('with element returns the element');
3+
4+
test.todo('with a string returns the element if exists');
5+
6+
test.todo('with a string throws invariant if does not exist');
7+
});

packages/autocomplete-js/src/utils/getHTMLElement.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import { invariant } from '@algolia/autocomplete-shared';
22

33
export function getHTMLElement(value: string | HTMLElement): HTMLElement {
44
if (typeof value === 'string') {
5-
const element = document.querySelector<HTMLElement>(value)!;
5+
const element = document.querySelector<HTMLElement>(value);
66

77
invariant(
88
element !== null,
99
`The element ${JSON.stringify(value)} is not in the document.`
1010
);
1111

12-
return element;
12+
return element!;
1313
}
1414

1515
return value;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
describe('createAlgoliaInsightsPlugin', () => {
2+
test.todo('tests');
3+
});
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
describe('createQuerySuggestionsPlugin', () => {
2+
test.todo('adds a source');
3+
4+
test.todo('fills the input with the query item key');
5+
6+
test.todo('renders the template');
7+
8+
test.todo('supports custom templates');
9+
10+
test.todo('fills the query on action button click');
11+
12+
test.todo('supports user search params');
13+
});
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
describe('createRecentSearchesPlugin', () => {
2+
test.todo('saves the query on select');
3+
4+
test.todo('does not save the query on select without item input value');
5+
6+
test.todo('saves the query on submit');
7+
8+
test.todo('does not save empty query on submit');
9+
10+
test.todo('does not add source without recent searches');
11+
12+
test.todo('adds source with recent searches');
13+
14+
test.todo('renders the template');
15+
16+
test.todo('supports custom templates');
17+
18+
test.todo('removes the recent searche on action button click');
19+
20+
test.todo('exports `getAlgoliaSearchParams` data');
21+
});

0 commit comments

Comments
 (0)