-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 more functionality to the room list vm #29402
Conversation
MidhunSureshR
commented
Mar 3, 2025
- Listen for updates from the store
- Provide a method to open rooms
ce338a8
to
c40acd7
Compare
3719642
to
ccbded1
Compare
c40acd7
to
81ea160
Compare
ccbded1
to
f6b33c9
Compare
- Listen for updates from the store - Provide a method to open rooms
f6b33c9
to
b754c61
Compare
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 insufficient coverage
About the coverage, there's already tests for this in https://github.com/element-hq/element-web/pull/29368/files#diff-9d33891dc652c5aa536ce75c66f8e212abc4f4fb002f6599d518eec498e1fed6R37-R52. Will try to avoid this happening in future but would appreciate an exception this time. |
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 suggest copying the tests over or something as this should not land without coverage. I don't see any reason why this code needs an exception, the approach looks perfectly testable.
I agree with t3chguy. In #29368, the room list tests mock the view model. So any change to the view model is not covered by my PR's unit tests. |
Writing individual tests for the views and view models means testing the implementation rather than the behaviour. This is antithetical to the philosophy of RTL, see https://testing-library.com/docs/guiding-principles. We will end up with a lot of view only tests that provide little value eg: asserting that clicking a button calls the right method in the vm. We will end up with multiple tests that fail on even minor refactoring. Worse yet, testing the behaviour becomes optional since the only other way we can test the behaviour is through playwright tests and they are optional. Anyhow, have added the tests to get this PR merged. |