Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 50e6e0c

Browse files
committed
Pascal case for language
1 parent 108c77e commit 50e6e0c

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

site/src/components/SignIn/SignInForm.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface BuiltInAuthFormValues {
1919
password: string
2020
}
2121

22-
export const LANGUAGE = {
22+
export const Language = {
2323
emailLabel: "Email",
2424
passwordLabel: "Password",
2525
emailInvalid: "Please enter a valid email address.",
@@ -29,7 +29,7 @@ export const LANGUAGE = {
2929
}
3030

3131
const validationSchema = Yup.object({
32-
email: Yup.string().trim().email(LANGUAGE.emailInvalid).required(LANGUAGE.emailRequired),
32+
email: Yup.string().trim().email(Language.emailInvalid).required(Language.emailRequired),
3333
password: Yup.string(),
3434
})
3535

@@ -76,7 +76,7 @@ export const SignInForm: React.FC<SignInFormProps> = ({ isLoading, authErrorMess
7676
autoComplete="email"
7777
className={styles.loginTextField}
7878
fullWidth
79-
label={LANGUAGE.emailLabel}
79+
label={Language.emailLabel}
8080
variant="outlined"
8181
/>
8282
<TextField
@@ -85,18 +85,18 @@ export const SignInForm: React.FC<SignInFormProps> = ({ isLoading, authErrorMess
8585
className={styles.loginTextField}
8686
fullWidth
8787
id="password"
88-
label={LANGUAGE.passwordLabel}
88+
label={Language.passwordLabel}
8989
type="password"
9090
variant="outlined"
9191
/>
9292
{authErrorMessage && (
9393
<FormHelperText data-testid="sign-in-error" error>
94-
{LANGUAGE.authErrorMessage}
94+
{Language.authErrorMessage}
9595
</FormHelperText>
9696
)}
9797
<div className={styles.submitBtn}>
9898
<LoadingButton color="primary" loading={isLoading} fullWidth type="submit" variant="contained">
99-
{isLoading ? "" : LANGUAGE.signIn}
99+
{isLoading ? "" : Language.signIn}
100100
</LoadingButton>
101101
</div>
102102
</form>

site/src/pages/login.test.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { history, render } from "../test_helpers"
55
import { SignInPage } from "./login"
66
import { server } from "../test_helpers/server"
77
import { rest } from "msw"
8-
import { LANGUAGE } from "../components/SignIn/SignInForm"
8+
import { Language } from "../components/SignIn/SignInForm"
99

1010
describe("SignInPage", () => {
1111
beforeEach(() => {
@@ -23,7 +23,7 @@ describe("SignInPage", () => {
2323
render(<SignInPage />)
2424

2525
// Then
26-
await screen.findByText(LANGUAGE.signIn, { exact: false })
26+
await screen.findByText(Language.signIn, { exact: false })
2727
})
2828

2929
it("shows an error message if SignIn fails", async () => {
@@ -38,17 +38,17 @@ describe("SignInPage", () => {
3838

3939
// When
4040
// Set email / password
41-
const email = screen.getByLabelText(LANGUAGE.emailLabel)
42-
const password = screen.getByLabelText(LANGUAGE.passwordLabel)
41+
const email = screen.getByLabelText(Language.emailLabel)
42+
const password = screen.getByLabelText(Language.passwordLabel)
4343
userEvent.type(email, "[email protected]")
4444
userEvent.type(password, "password")
4545
// Click sign-in
46-
const signInButton = await screen.findByText(LANGUAGE.signIn)
46+
const signInButton = await screen.findByText(Language.signIn)
4747
act(() => signInButton.click())
4848

4949
// Then
5050
// Finding error by test id because it comes from the backend
51-
const errorMessage = await screen.findByText(LANGUAGE.authErrorMessage)
51+
const errorMessage = await screen.findByText(Language.authErrorMessage)
5252
expect(errorMessage).toBeDefined()
5353
expect(history.location.pathname).toEqual("/login")
5454
})

0 commit comments

Comments
 (0)