mirror of
https://gitlab.nic.cz/turris/reforis/foris-js.git
synced 2024-11-14 17:35:35 +01:00
Fix CustomizationContextMock for tests
This commit is contained in:
parent
f3694bb62c
commit
6183669c9b
|
@ -25,13 +25,13 @@ Wrapper.propTypes = {
|
||||||
|
|
||||||
function Wrapper({ children }) {
|
function Wrapper({ children }) {
|
||||||
return (
|
return (
|
||||||
<AlertContextMock>
|
<CustomizationContextMock>
|
||||||
<CustomizationContextMock>
|
<AlertContextMock>
|
||||||
<StaticRouter>
|
<StaticRouter>
|
||||||
<UIDReset>{children}</UIDReset>
|
<UIDReset>{children}</UIDReset>
|
||||||
</StaticRouter>
|
</StaticRouter>
|
||||||
</CustomizationContextMock>
|
</AlertContextMock>
|
||||||
</AlertContextMock>
|
</CustomizationContextMock>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,12 +9,23 @@ import React from "react";
|
||||||
|
|
||||||
window.CustomizationContext = React.createContext();
|
window.CustomizationContext = React.createContext();
|
||||||
|
|
||||||
const deviceDetails = {};
|
const deviceDetails = {
|
||||||
const isCustomized = jest.fn();
|
kernel: "5.x.x",
|
||||||
|
model: "Turris Omnia",
|
||||||
|
os_branch: {
|
||||||
|
mode: "branch",
|
||||||
|
value: "hbs",
|
||||||
|
},
|
||||||
|
os_version: "6.x.x",
|
||||||
|
reforis_version: "1.x.x",
|
||||||
|
serial: 123456789,
|
||||||
|
};
|
||||||
|
|
||||||
|
const isCustomized = false;
|
||||||
|
|
||||||
function CustomizationContextMock({ children }) {
|
function CustomizationContextMock({ children }) {
|
||||||
return (
|
return (
|
||||||
<CustomizationContext.Provider value={(deviceDetails, isCustomized)}>
|
<CustomizationContext.Provider value={{ deviceDetails, isCustomized }}>
|
||||||
{children}
|
{children}
|
||||||
</CustomizationContext.Provider>
|
</CustomizationContext.Provider>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user