Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

bug: Unwanted content displayed in search suggestion box when there are no results for search #1252

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
8ae1943
Update index.md (#1139)
abrarpathan19 Apr 17, 2019
b1dba9e
Revert "Update index.md (#1139)"
jimbo Apr 17, 2019
4108607
Merge branch 'master' of https://github.com/khoa-le/pwa-studio into d…
khoa-le May 17, 2019
921c26b
Merge branch 'develop' of https://github.com/khoa-le/pwa-studio into …
khoa-le May 17, 2019
755a6e1
Disable render suggestion component when search query have not results.
khoa-le May 17, 2019
9a85242
Cover both items is null or empty array
khoa-le May 17, 2019
f318fb6
Merge branch 'develop' into bugfix/1223-Hide-unwanted-content-when-no…
khoa-le May 24, 2019
f945357
Merge branch 'develop' into bugfix/1223-Hide-unwanted-content-when-no…
khoa-le May 28, 2019
00295e7
Merge branch 'develop' into bugfix/1223-Hide-unwanted-content-when-no…
khoa-le Jun 1, 2019
ffc8ee3
Merge branch 'develop' into bugfix/1223-Hide-unwanted-content-when-no…
khoa-le Jun 7, 2019
dba0ae7
Merge branch 'develop' into bugfix/1223-Hide-unwanted-content-when-no…
khoa-le Jun 8, 2019
70e6494
Merge branch 'develop' into bugfix/1223-Hide-unwanted-content-when-no…
khoa-le Jun 15, 2019
d225c82
Merge branch 'develop' into bugfix/1223-Hide-unwanted-content-when-no…
supernova-at Jun 24, 2019
4155b64
Merge branch 'develop' into bugfix/1223-Hide-unwanted-content-when-no…
supernova-at Jun 25, 2019
d005a09
Merge branch 'develop' into bugfix/1223-Hide-unwanted-content-when-no…
sirugh Jun 26, 2019
094165e
Cover changes with tests
tjwiebell Jun 26, 2019
5dd816f
Merge branch 'develop' into bugfix/1223-Hide-unwanted-content-when-no…
sirugh Jun 26, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const filters = [
test('renders correctly', () => {
const products = {
filters: [],
items: []
items: [{}]
};

const instance = createTestInstance(
Expand Down Expand Up @@ -63,10 +63,23 @@ test('renders null if visible is false', () => {
expect(root.children).toEqual([]);
});

test('renders null if items array is empty', () => {
const products = {
filters: [],
items: []
};

const { root } = createTestInstance(
<Suggestions products={products} visible={true} />
);

expect(root.children).toEqual([]);
});

test('renders a category list', () => {
const products = {
filters,
items: []
items: [{}]
};

const { root } = createTestInstance(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const Suggestions = props => {
setVisible(false);
}, [setVisible]);

if (!visible || !filters || !items) {
if (!visible || !filters || !items || !items.length) {
return null;
}

Expand Down