-
Notifications
You must be signed in to change notification settings - Fork 38
feat: do not allow renaming file with extension (WPB-18314) #4114
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
base: develop
Are you sure you want to change the base?
Conversation
|
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.
LGTM ! Just a question to understand better the need of the change in renameNodeViewModel
, as it seems not necessary at all to pass the argument to the function to rename.
@@ -91,7 +91,7 @@ fun RenameNodeScreen( | |||
) { | |||
WirePrimaryButton( | |||
text = stringResource(R.string.rename_label), | |||
onClick = { renameNodeViewModel.renameNode() }, | |||
onClick = { renameNodeViewModel.renameNode(renameNodeViewModel.textState.text.toString()) }, |
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.
Question: Why do we need to pass the reference ? Since we could just access it from within the viewmodel, like it was before ? 🤔
|
||
advanceUntilIdle() | ||
viewModel.actions.test { | ||
with(expectMostRecentItem()) { | ||
assertEquals(false, viewModel.displayNameState.loading) | ||
assertEquals(DisplayNameState.Completed.Success, viewModel.displayNameState.completed) | ||
assertTrue(this is RenameNodeViewModelAction.Success) | ||
coVerify(exactly = 1) { arrangement.renameNodeUseCase(eq(UUID), eq(CURRENT_PATH), eq("newFileName.txt")) } | ||
} | ||
} | ||
} | ||
|
||
@Test | ||
fun `given renameNodeUseCase failure, when rename is called, then send failure action`() = runTest { |
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.
Can we also have test for InvalidNameError
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764
The PR Description
What's new in this PR?
Issues
Testing
Test Coverage (Optional)
How to Test
Briefly describe how this change was tested and if applicable the exact steps taken to verify that it works as expected.
Notes (Optional)
Specify here any other facts that you think are important for this issue.
Attachments (Optional)
Attachments like images, videos, etc. (drag and drop in the text box)
PR Post Submission Checklist for internal contributors (Optional)
PR Post Merge Checklist for internal contributors
References
feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764
.