correct naming of Generalinfos and added tests
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import {shallow} from "enzyme";
|
||||
import React from "react";
|
||||
import GeneralSettings from "./GeneralSettings";
|
||||
import GlobalInfos from "../../GlobalInfos";
|
||||
|
||||
function prepareFetchApi(response) {
|
||||
const mockJsonPromise = Promise.resolve(response);
|
||||
@ -25,6 +26,15 @@ describe('<GeneralSettings/>', function () {
|
||||
expect(wrapper.find("[data-testid='passwordfield']")).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('test theme switchbutton', function () {
|
||||
const wrapper = shallow(<GeneralSettings/>);
|
||||
|
||||
GlobalInfos.enableDarkTheme(false);
|
||||
expect(GlobalInfos.isDarkTheme()).toBe(false);
|
||||
wrapper.find("[data-testid='darktheme-switch']").simulate("change");
|
||||
expect(GlobalInfos.isDarkTheme()).toBe(true);
|
||||
});
|
||||
|
||||
it('test savesettings', done => {
|
||||
const wrapper = shallow(<GeneralSettings/>);
|
||||
|
||||
|
Reference in New Issue
Block a user