-
Notifications
You must be signed in to change notification settings - Fork 351
notif: Add more tests for messaging style notif and fix for fetchBitmap #813
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
Conversation
c7d47ce to
b59b751
Compare
Khader-1
left a comment
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.
Thanks @rajveermalviya! Aside from some nits this looks good.
Also, I'd suggest to change the title of the PR to mention the update in the production code as well.
66738ac to
09c6cab
Compare
|
Thanks for the review @Khader-1, new revision pushed. |
Khader-1
left a comment
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.
Thanks @rajveermalviya for the revision! Just a tiny nit that I didn't catch in the previous review.
09c6cab to
dadbcba
Compare
Khader-1
left a comment
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.
Thanks @rajveermalviya! LGTM. Over to mentor review now.
kenclary
left a comment
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.
looks good
|
With this command: (running After you fix those (and any failures on other commits; I haven't checked), I'll give this a proper review. 🙂 |
a59eb50 to
03444bb
Compare
|
Thanks for the review @chrisbobbe, pushed a new revision, PTAL. |
chrisbobbe
left a comment
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.
Thanks! Small comments below, and I'll mark this for Greg's review.
test/notifications/display_test.dart
Outdated
| T Function() callback, { | ||
| http.Client Function()? httpClientFactory, | ||
| }) { | ||
| return http.runWithClient(callback, httpClientFactory ?? () => fakeHttpClient); |
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.
For reading the ?? () => fakeHttpClient, I think it could help if fakeHttpClient had a more specific name, like fakeHttpClientGivingSuccess or something.
| expectedTagComponent: expectedTagComponent); | ||
| }))); | ||
|
|
||
| test('stream message: multiple messages, different topics', () => runWithHttpClient(() => awaitFakeAsync((async) async { |
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.
notif test: Add more tests for messaging style notif
Add more tests for Android messaging style notif implementation,
listed here:
#718 (review)
It looks like you meant to link to a specific comment in #718, but there isn't a link to the comment.
gnprice
left a comment
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.
Thanks @rajveermalviya for writing this, and @Khader-1 @chrisbobbe for the previous reviews!
These tests look great. I agree with Chris's small comments above, and have a few nits below. Then this will be all ready to merge.
test/notifications/display_test.dart
Outdated
| TestZulipBinding.ensureInitialized(); | ||
| final zulipLocalizations = GlobalLocalizations.zulipLocalizations; | ||
|
|
||
| makeFakeHttpClient({http.Response? response, Exception? exception}) => http_testing.MockClient((request) async { |
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.
nit: explicit return type for function declaration, so it doesn't look like a function call
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.
Looks like there is indeed a lint rule for this, always_declare_return_types:
https://dart.dev/tools/linter-rules/always_declare_return_types
I'll see about turning that on, since it keeps coming up.
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.
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.
I'll see about turning that on, since it keeps coming up.
→ #851
test/notifications/display_test.dart
Outdated
| }); | ||
| final fakeHttpClient = makeFakeHttpClient( |
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.
nit: blank line
| }); | |
| final fakeHttpClient = makeFakeHttpClient( | |
| }); | |
| final fakeHttpClient = makeFakeHttpClient( |
03444bb to
3530d94
Compare
|
Thanks for the review @chrisbobbe, @gnprice. Pushed a new revision, PTAL. |
3530d94 to
289cea8
Compare
gnprice
left a comment
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.
Thanks again! Looks great — merging.
| expectedTitle: otherUser.fullName, | ||
| expectedTagComponent: expectedTagComponent); | ||
|
|
||
| otherUser.email = '[email protected]'; |
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 good catch — I missed this in my review of the previous revision 🙂
Add more tests for Android messaging style notif implementation, listed here: zulip#718 (review)
289cea8 to
915b166
Compare
Add more tests for Android messaging style notif implementation, listed here: #718 (review)