-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(code_push_protocol): create collaborators via email (#506)
- Loading branch information
Showing
5 changed files
with
14 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,7 @@ void main() { | |
|
||
group('createAppCollaborator', () { | ||
const appId = 'test-app-id'; | ||
const userId = 42; | ||
const email = '[email protected]'; | ||
|
||
test('throws an exception if the http request fails (unknown)', () async { | ||
when( | ||
|
@@ -69,7 +69,7 @@ void main() { | |
); | ||
|
||
expect( | ||
codePushClient.createAppCollaborator(appId: appId, userId: userId), | ||
codePushClient.createAppCollaborator(appId: appId, email: email), | ||
throwsA( | ||
isA<CodePushException>().having( | ||
(e) => e.message, | ||
|
@@ -95,7 +95,7 @@ void main() { | |
); | ||
|
||
expect( | ||
codePushClient.createAppCollaborator(appId: appId, userId: userId), | ||
codePushClient.createAppCollaborator(appId: appId, email: email), | ||
throwsA( | ||
isA<CodePushException>().having( | ||
(e) => e.message, | ||
|
@@ -115,10 +115,7 @@ void main() { | |
), | ||
).thenAnswer((_) async => http.Response('', HttpStatus.created)); | ||
|
||
await codePushClient.createAppCollaborator( | ||
appId: appId, | ||
userId: userId, | ||
); | ||
await codePushClient.createAppCollaborator(appId: appId, email: email); | ||
|
||
final uri = verify( | ||
() => httpClient.post( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
..._protocol/lib/src/messages/create_app_collaborator/create_app_collaborator_request.g.dart
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,9 @@ import 'package:test/test.dart'; | |
void main() { | ||
group(CreateAppCollaboratorRequest, () { | ||
test('can be (de)serialized', () { | ||
const request = CreateAppCollaboratorRequest(userId: 42); | ||
const request = CreateAppCollaboratorRequest( | ||
email: '[email protected]', | ||
); | ||
expect( | ||
CreateAppCollaboratorRequest.fromJson(request.toJson()).toJson(), | ||
equals(request.toJson()), | ||
|