Commit b9e5d0c9 authored by Mark Florian's avatar Mark Florian

Use more natural expectation

Previously the `|| null` was ensuring that the return type of the helper
function was `HTMLElement | null`, rather than `HTMLElement | null
| undefined`, which allowed the tests to check against just `null`.
Instead of documenting that oddness, this just changes the tests to
expect an HTMLElement (or not), removing the need to avoid `undefined`.
parent d4f206d4
......@@ -26,8 +26,7 @@ describe('Filter component', () => {
});
}
const findSearchInput = () =>
(vm.$refs.searchBox || null) && vm.$refs.searchBox.$el.querySelector('input');
const findSearchInput = () => vm.$refs.searchBox && vm.$refs.searchBox.$el.querySelector('input');
beforeEach(() => {
store = createStore();
......@@ -57,7 +56,7 @@ describe('Filter component', () => {
});
it('should not have a search box', () => {
expect(findSearchInput()).toBeNull();
expect(findSearchInput()).not.toEqual(jasmine.any(HTMLElement));
});
it('should not be open', () => {
......@@ -101,7 +100,7 @@ describe('Filter component', () => {
});
it('should display a search box', () => {
expect(findSearchInput()).not.toBeNull();
expect(findSearchInput()).toEqual(jasmine.any(HTMLElement));
});
it(`should show all projects`, () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment