parent
30c963a5f0
commit
61a1c93f0f
89 changed files with 15859 additions and 2 deletions
32
client/components/composite/tests/auth_pane.test.jsx
Normal file
32
client/components/composite/tests/auth_pane.test.jsx
Normal file
|
@ -0,0 +1,32 @@
|
|||
import React from "react";
|
||||
import { AuthPane, classLogin, classLogout } from "../auth_pane";
|
||||
|
||||
describe("AuthPane", () => {
|
||||
test("AuthPane should show login pane if isLogin === true, or show logout pane", () => {
|
||||
const tests = [
|
||||
{
|
||||
input: {
|
||||
onLogin: jest.fn,
|
||||
onLogout: jest.fn,
|
||||
isLogin: false,
|
||||
serverAddr: ""
|
||||
},
|
||||
output: classLogin
|
||||
},
|
||||
{
|
||||
input: {
|
||||
onLogin: jest.fn,
|
||||
onLogout: jest.fn,
|
||||
isLogin: true,
|
||||
serverAddr: ""
|
||||
},
|
||||
output: classLogout
|
||||
}
|
||||
];
|
||||
|
||||
tests.forEach(testCase => {
|
||||
const pane = new AuthPane(testCase.input);
|
||||
expect(pane.render().props.className).toBe(testCase.output);
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue