correct naming of Generalinfos and added tests
This commit is contained in:
24
src/GlobalInfos.test.js
Normal file
24
src/GlobalInfos.test.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import React from "react";
|
||||
import GlobalInfos from "./GlobalInfos";
|
||||
|
||||
describe('<GlobalInfos/>', function () {
|
||||
it('always same instance ', function () {
|
||||
GlobalInfos.enableDarkTheme(true);
|
||||
|
||||
expect(GlobalInfos.isDarkTheme()).toBe(true);
|
||||
|
||||
GlobalInfos.enableDarkTheme(false);
|
||||
|
||||
expect(GlobalInfos.isDarkTheme()).toBe(false);
|
||||
});
|
||||
|
||||
it('test default theme', function () {
|
||||
expect(GlobalInfos.isDarkTheme()).toBe(false);
|
||||
});
|
||||
|
||||
it('test receive of stylesheet', function () {
|
||||
const style = GlobalInfos.getThemeStyle();
|
||||
|
||||
expect(style.navitem).not.toBeNull();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user