-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a test for the login flow when there is a teamserver #4315
Conversation
- just to check it keeps working.
test/app-tests/loading.js
Outdated
@@ -343,6 +346,40 @@ describe('loading:', function () { | |||
}).done(done, done); | |||
}); | |||
|
|||
it("registers correctly with a Riot Team Server", function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should really be "logs in to the Riot Team Server". I would be awesome to test the slightly more important flow of a user registering with a team email address and being tracked as a referral! (this is already done as unit test but the entire flow isn't yet tested)
test/app-tests/loading.js
Outdated
@@ -343,6 +346,40 @@ describe('loading:', function () { | |||
}).done(done, done); | |||
}); | |||
|
|||
it("registers correctly with a Riot Team Server", function() { | |||
sdk.setFetch(httpBackend.fetchFn); // XXX: ought to restore this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I haven't convinced myself how this is getting used but I shall look when I get in this morning!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I'm pretty convinced that sdk
should be RtsClient
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no... it goes through here.
(it turns out that if I import RtsClient
directly, then I get a different RtsClient to that being used by the react-sdk, which means that replacing its fetchFn doesn't work. I think that's due to webpack/webpack#2740. In the end I decided it probably makes sense to replace the fetchfn for the whole of the sdk anyway.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, in which case I'd suggest renaming the one exported in the sdk to be setRtsFetchFn
. and it doesn't look like you're replacing fetchfn for the whole of the sdk ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, I'm not, but it's only used in RtsClient and autocomplete/DuckDuckGoProvider.js for now. The thinking is that we can add more things to sdk.setFetch if and when it is useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah ok, np
logs in, not registers
Requires matrix-org/matrix-react-sdk#1098