-
Notifications
You must be signed in to change notification settings - Fork 94
Conversation
- add two new assets from @waynecrosby for the theme previews - add AppTheme to main.dart and a new ChangeNotifierProvider for other Widgets to watch the theme change - add ChoseYourLookPage to the routes - add ChoseYourLookPage for the current design
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.
- Should it be called 'Choose your look'?
- I didn't notice any changes to
pubspec.yaml
. Isgsettings
missing? - It would be nice to generate
MockGSettings
withmockito
and have simple tests thatAppTheme.apply()
calls the right methods with correct arguments. Could even go one step further and add a widget test that presses the theme buttons.
One more: P.S. This one is actually a good example of why it's nice to have |
I don't really understand this one. I need to create a test for the CI to pass? AppTheme is in a sep. file now :) |
- build from OptionCard instead of radios - Correct the name to "Choose ..." - add localisation - add a subtitle
In
Yes, it's part of the task. There's a check that the test coverage doesn't reduce significantly. :)
👍 |
Codecov Report
@@ Coverage Diff @@
## main #126 +/- ##
==========================================
+ Coverage 68.95% 70.48% +1.52%
==========================================
Files 25 27 +2
Lines 1047 1108 +61
==========================================
+ Hits 722 781 +59
- Misses 325 327 +2
Continue to review full report at Codecov.
|
@jpnurmi added a test for the theme toggling, now the test fails on GitHub even if it passes locally 🤔 |
packages/ubuntu_desktop_installer/test/choose_your_look_page_test.dart
Outdated
Show resolved
Hide resolved
P.S. In case anyone wonder's about the gsettings.dart dependency, I'm happy to transfer the package to Canonical later. ;) |
Probably missing some dependencies (e.g. DBUS daemon running?) and would probably even need to be run via Xvfb. I'd suggest leaving that test out for now until we have a GSettings mock available. It's not desired to mess with the system theme in tests anyway. 🙂 |
okay so just revert back to the previous "count all the widgets" test? |
MockGSettings can be used to verify GSettings calls without messing with system settings. Ref: #126
Because a plain mock is enough for this test... ;-) Ref: #126
Test and verify that when a theme is applied, the appropriate GSettings methods are called with correct arguments and in correct order. Ref: #126
- Mock AppTheme because in this test we only care that the right theme method is called, but not what AppTheme does internally. AppTheme has its own tests to verify that it does the right thing. ;) - Test the actual functionality of the page by tapping the appropriate OptionCards, which are searched by using localized strings so that the test continues to work even if the text is changed later. Also, this approach doesn't care how many text labels there are, because UI design changes tend to come and go while the app is still under heavy development. Ref: #126
@Feichtmeier, I pushed some mocked test proposals to my fork. The changes are referenced above and there are explanations in each commit message. What do you think? |
Looks nice - mind pushing this to this branch? |
I can't push to your branch, but you can try to pull the changes: |
@jpnurmi worked 👍 Thank you! |
I hope you don't mind the last change which is somewhat opinionated. Creating a page instance and counting widgets gives nice coverage results, but in the end, it doesn't test much. 🙃 Testing the functionality without making too many assumptions on the UI layout gives confidence that the page does the right thing, but more freedom for the design to evolve without needing to update tests because of minor UI tweaks. 😉 |
- WizardPage: reduce AppBar elevation to 1.0 to make it flat - OpionCard: change selected state to be flat, with accent color text and border
Updated OptionCard and WizardPage according to the discussion here: #84 (comment) |
Yes, this is okay for now, until we implement more pages. Could you please link the current last page ("allocate disk space") to this new page, so when pressing "Start Installing" this new page is displayed? This will ease manual testing, and the order of pages can be re-shuffled later on. |
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.
P.S. The appbar and option card changes could be even a separate PR. It would be quick to review and those changes are not strictly related to this PR anyway. :)
Seconded! |
This reverts commit aa61ad2.
@oSoMoN sorry to ask one more time, but I did not really understand you here.
Never mind, my branch was outdated |
…staller into Chose_your_look
- navigate to ChooseYourLookPage
@oSoMoN I think this is what you meant, right? :) |
Yes, indeed. |
@oSoMoN your requested change now conflicts with the recent commit in oSoMoN@15b62ba Shall I again overwrite it as requested or change lines to what is in master now? |
Yes, sorry about that. Can you please rebase on master, and add your page to the end of the current last page ("Write changes to disk")? |
…staller into Chose_your_look
- navigate to ChooseYourLookPage on continute action
Done 👍 - I hope merging upstream main into my branch was also okay? I guess you squash and merge anyways, right? :) |
LGTM, thanks! |
TODO:
Closes #84
Closes #128
Thanks @jpnurmi for the help <3