Write some tests for the RTS UI

Add tests that make assertions about the UI during registration when registration is done with a user recognised as a team member (by the mock rtsClient).
This commit is contained in:
Luke Barnard 2017-05-17 09:46:17 +01:00
parent ca907f42dc
commit e1089574ae
4 changed files with 206 additions and 2 deletions

View file

@ -137,6 +137,20 @@ export function createTestClient() {
};
}
export function createTestRtsClient(teamMap, sidMap) {
return {
getTeamsConfig() {
return q(Object.keys(teamMap).map((token) => teamMap[token]));
},
trackReferral(referrer, emailSid, clientSecret) {
return q({team_token: sidMap[emailSid]});
},
getTeam(teamToken) {
return q(teamMap[teamToken]);
},
};
}
/**
* Create an Event.
* @param {Object} opts Values for the event.