Update tests for better coverage
This commit is contained in:
parent
a24579420a
commit
fcd99434a0
2 changed files with 11 additions and 5 deletions
|
@ -1,7 +1,5 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`select.tsx Tests \`current\`-value 1`] = `[Function]`;
|
||||
|
||||
exports[`select.tsx Tests \`current\`-value with testId 1`] = `[Function]`;
|
||||
|
||||
exports[`select.tsx Tests \`current\`-value without testId 1`] = `[Function]`;
|
||||
|
@ -9,5 +7,3 @@ exports[`select.tsx Tests \`current\`-value without testId 1`] = `[Function]`;
|
|||
exports[`select.tsx Tests Select rendering 1`] = `[Function]`;
|
||||
|
||||
exports[`select.tsx Tests rendering of multiple Select elements 1`] = `[Function]`;
|
||||
|
||||
exports[`select.tsx Tests select rendering 1`] = `[Function]`;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { getTheme, IThemeProps, setTheme } from "../../lib/useTheme";
|
||||
import { getTheme, IThemeProps, setScheme, setTheme } from "../../lib/useTheme";
|
||||
|
||||
const props: IThemeProps = {
|
||||
label: "Classic",
|
||||
|
@ -28,6 +28,16 @@ const setup = () => {
|
|||
};
|
||||
|
||||
describe("theme.tsx", () => {
|
||||
it("Tests setScheme", () => {
|
||||
setup();
|
||||
|
||||
let value = "dark";
|
||||
|
||||
setScheme(value);
|
||||
expect(window.localStorage.setItem).toHaveBeenCalledTimes(1);
|
||||
expect(window.localStorage.setItem).toHaveBeenCalledWith("theme", value);
|
||||
});
|
||||
|
||||
it("setTheme light test", () => {
|
||||
setup();
|
||||
|
||||
|
|
Loading…
Reference in a new issue