You've already forked matrix-react-sdk
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:
@ -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();
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user