Skip to content
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

Merged
merged 2 commits into from
Jun 15, 2017

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Jun 15, 2017

  • just to check it keeps working.

Requires matrix-org/matrix-react-sdk#1098

@@ -343,6 +346,40 @@ describe('loading:', function () {
}).done(done, done);
});

it("registers correctly with a Riot Team Server", function() {
Copy link
Contributor

@lukebarnard1 lukebarnard1 Jun 15, 2017

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)

@@ -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!
Copy link
Contributor

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!

Copy link
Contributor

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

Copy link
Member Author

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.)

Copy link
Contributor

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 ...

Copy link
Member Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok, np

@lukebarnard1 lukebarnard1 assigned richvdh and unassigned lukebarnard1 Jun 15, 2017
logs in, not registers
@richvdh richvdh merged commit a7a7ffd into develop Jun 15, 2017
@richvdh richvdh deleted the rav/test_rts_login branch June 15, 2017 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants