mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-08 02:24:08 +00:00
Lint and make App (Component) functional
This commit is contained in:
@@ -19,27 +19,27 @@ describe("AddUser Component: ", () => {
|
||||
);
|
||||
|
||||
it("Renders", () => {
|
||||
let component = shallow(addUserJsx(mockAsync()))
|
||||
expect(component.find(".container").length).toBe(1)
|
||||
})
|
||||
let component = shallow(addUserJsx(mockAsync()));
|
||||
expect(component.find(".container").length).toBe(1);
|
||||
});
|
||||
|
||||
it("Removes users when they fail Regex", () => {
|
||||
let callbackSpy = mockAsync(),
|
||||
component = shallow(addUserJsx(callbackSpy)),
|
||||
textarea = component.find("textarea").first()
|
||||
textarea.simulate("blur", { target: { value: "foo\nbar\n!!*&*"}})
|
||||
let submit = component.find("#submit")
|
||||
submit.simulate("click")
|
||||
expect(callbackSpy).toHaveBeenCalledWith(["foo", "bar"], false)
|
||||
})
|
||||
textarea = component.find("textarea").first();
|
||||
textarea.simulate("blur", { target: { value: "foo\nbar\n!!*&*" } });
|
||||
let submit = component.find("#submit");
|
||||
submit.simulate("click");
|
||||
expect(callbackSpy).toHaveBeenCalledWith(["foo", "bar"], false);
|
||||
});
|
||||
|
||||
it("Correctly submits admin", () => {
|
||||
let callbackSpy = mockAsync(),
|
||||
component = shallow(addUserJsx(callbackSpy)),
|
||||
input = component.find("input").first()
|
||||
input.simulate("change", { target: { checked: true }})
|
||||
let submit = component.find("#submit")
|
||||
submit.simulate("click")
|
||||
expect(callbackSpy).toHaveBeenCalledWith([], true)
|
||||
})
|
||||
input = component.find("input").first();
|
||||
input.simulate("change", { target: { checked: true } });
|
||||
let submit = component.find("#submit");
|
||||
submit.simulate("click");
|
||||
expect(callbackSpy).toHaveBeenCalledWith([], true);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user