From ddd18fc56dff99e62d96bda8ee9720ae2ea25882 Mon Sep 17 00:00:00 2001 From: Joseph Semrai Date: Tue, 31 Dec 2019 02:43:45 -0500 Subject: [PATCH] Add navbar component tests --- client/src/setupTests.js | 20 +++ .../navbar.component.test.js.snap | 169 ++++++++++++++++++ client/tests/navbar.component.test.js | 21 +++ 3 files changed, 210 insertions(+) create mode 100644 client/src/setupTests.js create mode 100644 client/tests/__snapshots__/navbar.component.test.js.snap create mode 100644 client/tests/navbar.component.test.js diff --git a/client/src/setupTests.js b/client/src/setupTests.js new file mode 100644 index 00000000..b31e19ee --- /dev/null +++ b/client/src/setupTests.js @@ -0,0 +1,20 @@ +var localStorageMock = (function () { + var store = {}; + return { + getItem: function (key) { + return store[key]; + }, + setItem: function (key, value) { + store[key] = value.toString(); + }, + clear: function () { + store = {}; + }, + removeItem: function (key) { + delete store[key]; + } + }; +})(); +Object.defineProperty(window, 'localStorage', { + value: localStorageMock +}); \ No newline at end of file diff --git a/client/tests/__snapshots__/navbar.component.test.js.snap b/client/tests/__snapshots__/navbar.component.test.js.snap new file mode 100644 index 00000000..2ae497e1 --- /dev/null +++ b/client/tests/__snapshots__/navbar.component.test.js.snap @@ -0,0 +1,169 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` Unit Tests renders correctly 1`] = ` +
+
+