Skip to content

Commit

Permalink
ui+tests+locales: updates tests & auth wording
Browse files Browse the repository at this point in the history
  • Loading branch information
dstrukt committed May 17, 2023
1 parent 7a52a01 commit a19e838
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
17 changes: 5 additions & 12 deletions app/src/__tests__/components/auth/AuthPage.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,9 @@ describe('AuthPage ', () => {
expect(getByText('Terminal')).toBeInTheDocument();
});

it('should display the password field', () => {
const { getByLabelText } = render();
expect(getByLabelText('Enter your password in the field above')).toBeInTheDocument();
});

it('should display the submit button', () => {
it('should display the login button', () => {
const { getByText } = render();
expect(getByText('Submit')).toBeInTheDocument();
expect(getByText('Login')).toBeInTheDocument();
});

it('should display nothing when the store is not initialized', () => {
Expand All @@ -49,7 +44,7 @@ describe('AuthPage ', () => {

it('should display an error when submitting an empty password', async () => {
const { getByText, findByText } = render();
fireEvent.click(getByText('Submit'));
fireEvent.click(getByText('Login'));
expect(await findByText('oops, password is required')).toBeInTheDocument();
});

Expand All @@ -59,10 +54,8 @@ describe('AuthPage ', () => {
return undefined as any;
});

const { getByText, getByLabelText, findByText } = render();
const input = getByLabelText('Enter your password in the field above');
fireEvent.change(input, { target: { value: 'test-pw' } });
fireEvent.click(getByText('Submit'));
const { getByText, findByText } = render();
fireEvent.click(getByText('Login'));
expect(await findByText('oops, that password is incorrect')).toBeInTheDocument();
});
});
2 changes: 1 addition & 1 deletion app/src/i18n/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"cmps.auth.AuthPage.terminal": "Terminal",
"cmps.auth.AuthPage.subtitle": "Efficiently manage Lightning node liquidity",
"cmps.auth.AuthPage.passLabel": "Enter your password in the field above",
"cmps.auth.AuthPage.submitBtn": "Submit",
"cmps.auth.AuthPage.loginBtn": "Login",
"cmps.common.Tile.maximizeTip": "Maximize",
"cmps.common.PageHeader.exportTip": "Download CSV",
"cmps.common.PageHeader.helpTip": "Take a Tour",
Expand Down

0 comments on commit a19e838

Please sign in to comment.