diff --git a/.routify/config.js b/.routify/config.js index 495df9dd..0df04486 100644 --- a/.routify/config.js +++ b/.routify/config.js @@ -8,5 +8,5 @@ module.exports = { noHashScroll: false, distDir: 'dist', extensions: ['svelte', 'html', 'svx', 'md'], - started: '2021-11-24T19:14:39.743Z', + started: '2021-11-25T19:05:29.616Z', }; diff --git a/.routify/routes.js b/.routify/routes.js index 4d534235..0b82f467 100644 --- a/.routify/routes.js +++ b/.routify/routes.js @@ -1,10 +1,10 @@ /** * @roxi/routify 2.7.3 - * File generated Wed Nov 24 2021 19:14:42 GMT+0000 (Greenwich Mean Time) + * File generated Thu Nov 25 2021 19:05:33 GMT+0000 (Greenwich Mean Time) */ export const __version = '2.7.3'; -export const __timestamp = '2021-11-24T19:14:42.752Z'; +export const __timestamp = '2021-11-25T19:05:33.824Z'; //buildRoutes import { buildClientTree } from '@roxi/routify/runtime/buildRoutes'; diff --git a/public/index.html b/public/index.html index 13dc5cb7..ed094464 100644 --- a/public/index.html +++ b/public/index.html @@ -11,9 +11,9 @@ - + - + diff --git a/src/components/HexGrid/HexGrid.svelte b/src/components/HexGrid/HexGrid.svelte index 961f1a18..3700e2e8 100644 --- a/src/components/HexGrid/HexGrid.svelte +++ b/src/components/HexGrid/HexGrid.svelte @@ -7,10 +7,11 @@ export let data: Base[] = []; export let categoryFn: BaseFn; - const createEmptyArray = () => new Array(data.length).fill(undefined); + const createEmptyArray = (length: number) => + new Array(length).fill(undefined); - let imgElemArr: HTMLImageElement[] = [...createEmptyArray()]; - let sourceElemArr: HTMLSourceElement[] = [...createEmptyArray()]; + let imgElemArr: HTMLImageElement[] = [...createEmptyArray(data.length)]; + let sourceElemArr: HTMLSourceElement[] = [...createEmptyArray(data.length)]; const handleError = (idx: number) => { imgElemArr[idx].onerror = null; diff --git a/src/components/TagView/TagView.svelte b/src/components/TagView/TagView.svelte index 6ea8951b..4e5b791e 100644 --- a/src/components/TagView/TagView.svelte +++ b/src/components/TagView/TagView.svelte @@ -43,4 +43,4 @@ }; - + diff --git a/src/components/TagView/TagView.test.ts b/src/components/TagView/TagView.test.ts index 1d32ca37..ff781052 100644 --- a/src/components/TagView/TagView.test.ts +++ b/src/components/TagView/TagView.test.ts @@ -71,8 +71,8 @@ describe('Given TagView', () => { 'hex-category-name' ); expect(allDisplayedCats).toHaveLength(2); - expect(allDisplayedCats[0]).toHaveTextContent('Zebra'); - expect(allDisplayedCats[1]).toHaveTextContent('Elephant'); + expect(allDisplayedCats[0]).toHaveTextContent('Elephant'); + expect(allDisplayedCats[1]).toHaveTextContent('Zebra'); }); it('AND a non tag category is clicked THEN fire the categoryFn', async () => { @@ -100,12 +100,12 @@ describe('Given TagView', () => { ); expect(allDisplayedCats).toHaveLength(2); - expect(allDisplayedCats[0]).toHaveTextContent('Buffalo'); - expect(allDisplayedCats[1]).toHaveTextContent('Elephant'); + expect(allDisplayedCats[0]).toHaveTextContent('Elephant'); + expect(allDisplayedCats[1]).toHaveTextContent('Buffalo'); const allButtons = await screen.queryAllByTestId('hex-button'); - userEvent.click(allButtons[1]); + userEvent.click(allButtons[0]); expect(mockFn).toHaveBeenCalledTimes(1); });