8000 refactor: extract dialog message to Language · coder/coder@286fde6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 286fde6

Browse files
committed
refactor: extract dialog message to Language
1 parent 0067770 commit 286fde6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

site/src/pages/UsersPage/UsersPage.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const suspendUser = async (setupActionSpies: () => void) => {
2424

2525
// Check if the confirm message is displayed
2626
const confirmDialog = screen.getByRole("dialog")
27-
expect(confirmDialog).toHaveTextContent("Do you want to suspend the user TestUser?")
27+
expect(confirmDialog).toHaveTextContent(`${UsersPageLanguage.suspendDialogMessagePrefix} ${MockUser.username}?`)
2828

2929
// Setup spies to check the actions after
3030
setupActionSpies()

site/src/pages/UsersPage/UsersPage.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { UsersPageView } from "./UsersPageView"
99
export const Language = {
1010
suspendDialogTitle: "Suspend user",
1111
suspendDialogAction: "Suspend",
12+
suspendDialogMessagePrefix: "Do you want to suspend the user",
1213
}
1314

1415
export const UsersPage: React.FC = () => {
@@ -56,7 +57,7 @@ export const UsersPage: React.FC = () => {
5657
}}
5758
description={
5859
<>
59-
Do you want to suspend the user <strong>{userToBeSuspended?.username}</strong>?
60+
{Language.suspendDialogMessagePrefix} <strong>{userToBeSuspended?.username}</strong>?
6061
</>
6162
}
6263
/>

0 commit comments

Comments
 (0)
0