Chore: Add 'isActive' extension menthods for CipherView and CipherListView#6769
Chore: Add 'isActive' extension menthods for CipherView and CipherListView#6769david-livefront merged 1 commit intomainfrom
Conversation
7517bfd to
0bc1eb7
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6769 +/- ##
==========================================
+ Coverage 85.33% 85.66% +0.33%
==========================================
Files 957 867 -90
Lines 60714 59783 -931
Branches 8634 8588 -46
==========================================
- Hits 51808 51215 -593
+ Misses 5900 5577 -323
+ Partials 3006 2991 -15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
New Issues (128)Checkmarx found the following issues in this Pull Request
|
andrebispo5
left a comment
There was a problem hiding this comment.
This is a very good refactor! 🥇
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE This PR introduces Code Review DetailsNo findings. The refactoring is straightforward and correctly preserves existing behavior. The remaining |
| @Test | ||
| fun `isActive should return true when item is not archived and is deleted`() { | ||
| val cipherListView = mockk<CipherListView> { | ||
| every { archivedDate } returns null | ||
| every { deletedDate } returns clock.instant() | ||
| } | ||
|
|
||
| assertFalse(cipherListView.isActive) | ||
| } | ||
|
|
||
| @Test |
There was a problem hiding this comment.
Details and fix
Line 40: isActive should return true when item is not archived and is deleted asserts assertFalse.
Line 50: isActive should return true when item is archived and is deleted asserts assertFalse.
Both test names should say "return false" to match the actual assertions:
| @Test | |
| fun `isActive should return true when item is not archived and is deleted`() { | |
| val cipherListView = mockk<CipherListView> { | |
| every { archivedDate } returns null | |
| every { deletedDate } returns clock.instant() | |
| } | |
| assertFalse(cipherListView.isActive) | |
| } | |
| @Test | |
| @Test | |
| fun `isActive should return false when item is not archived and is deleted`() { | |
| val cipherListView = mockk<CipherListView> { | |
| every { archivedDate } returns null | |
| every { deletedDate } returns clock.instant() | |
| } | |
| assertFalse(cipherListView.isActive) | |
| } | |
| @Test | |
| fun `isActive should return false when item is archived and is deleted`() { | |
| val cipherListView = mockk<CipherListView> { | |
| every { archivedDate } returns clock.instant() | |
| every { deletedDate } returns clock.instant() | |
| } | |
| assertFalse(cipherListView.isActive) | |
| } |
Misleading test names cause confusion when reading test reports or debugging failures.
| @Test | ||
| fun `isActive should return true when item is not archived and is deleted`() { | ||
| val cipherListView = mockk<CipherView> { | ||
| every { archivedDate } returns null | ||
| every { deletedDate } returns clock.instant() | ||
| } | ||
|
|
||
| assertFalse(cipherListView.isActive) | ||
| } | ||
|
|
||
| @Test |
There was a problem hiding this comment.
Details and fix
| @Test | |
| fun `isActive should return true when item is not archived and is deleted`() { | |
| val cipherListView = mockk<CipherView> { | |
| every { archivedDate } returns null | |
| every { deletedDate } returns clock.instant() | |
| } | |
| assertFalse(cipherListView.isActive) | |
| } | |
| @Test | |
| @Test | |
| fun `isActive should return false when item is not archived and is deleted`() { | |
| val cipherListView = mockk<CipherView> { | |
| every { archivedDate } returns null | |
| every { deletedDate } returns clock.instant() | |
| } | |
| assertFalse(cipherListView.isActive) | |
| } | |
| @Test | |
| fun `isActive should return false when item is archived and is deleted`() { | |
| val cipherListView = mockk<CipherView> { | |
| every { archivedDate } returns clock.instant() | |
| every { deletedDate } returns clock.instant() | |
| } | |
| assertFalse(cipherListView.isActive) | |
| } |
0bc1eb7 to
ecebb7a
Compare
|
Thanks @andrebispo5 |


🎟️ Tracking
N/A
📔 Objective
This PR adds helper functions for the
CipherVIewandCipherListViewto indicate if the ciphers are still active.Active is indicated by the cipher not being deleted or archived.
No functionality has changed in this PR.