1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-28 15:22:05 +03:00

Iterate tests

This commit is contained in:
Michael Telatynski
2020-11-25 10:22:16 +00:00
parent 758b47c64d
commit 1b1c482f9c
5 changed files with 108 additions and 39 deletions

View File

@ -48,12 +48,9 @@ describe('Registration', function() {
/>, parentDiv);
}
it('should show server type selector', function() {
it('should show server picker', function() {
const root = render();
const selector = ReactTestUtils.findRenderedComponentWithType(
root,
sdk.getComponent('auth.ServerTypeSelector'),
);
const selector = ReactTestUtils.findRenderedDOMComponentWithClass(root, "mx_ServerPicker");
expect(selector).toBeTruthy();
});
@ -79,4 +76,27 @@ describe('Registration', function() {
);
expect(form).toBeTruthy();
});
it("should show SSO options if those are available", () => {
jest.spyOn(SdkConfig, "get").mockReturnValue({
disable_custom_urls: true,
});
const root = render();
// Set non-empty flows & matrixClient to get past the loading spinner
root.setState({
flows: [{
stages: [],
}],
ssoFlow: {
type: "m.login.sso",
},
matrixClient: {},
busy: false,
});
const ssoButton = ReactTestUtils.findRenderedDOMComponentWithClass(root, "mx_SSOButton");
expect(ssoButton).toBeTruthy();
});
});