Skip to content

Commit

Permalink
STCOR-741 - Display error message when user does not enter a password…
Browse files Browse the repository at this point in the history
… in Login Page (#1465)

* STCOR-741 - err message on no password

* remove describe.only

* update changeLog

* resolve review comments

* STCOR-741 add required property to password input field
  • Loading branch information
manvendra-s-rathore authored May 18, 2024
1 parent be7f076 commit 142ff27
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Turn on `<StrictMode>`; ignore it with `stripes.config.js` `disableStrictMode: true`. Refs STCOR-841.
* Make branding optional. Refs STCOR-847.
* Idle-session timeout and "Keep working?" modal. Refs STCOR-776.
* Implement password validation for Login Page. Refs STCOR-741.

## [10.1.0](https://github.com/folio-org/stripes-core/tree/v10.1.0) (2024-03-12)
[Full Changelog](https://github.com/folio-org/stripes-core/compare/v10.0.0...v10.1.0)
Expand Down
1 change: 1 addition & 0 deletions src/components/Login/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ class Login extends Component {
validationEnabled={false}
hasClearIcon={false}
autoComplete="current-password"
required
/>
</Col>
</Row>
Expand Down
27 changes: 27 additions & 0 deletions test/bigtest/tests/login-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,33 @@ describe('Login', () => {
});
});

describe('error for the empty password field', () => {
setupApplication({
disableAuth: false,
scenarios: ['emptyPasswordField'],
});

beforeEach(async function () {
const { username, password, submit } = login;

await username.fill('username');
await password.fill('');
await submit.click();
});

it.always('username should not be reset upon failed submit', () => {
expect(login.username.value).to.equal('username');
});

it('should have submit button', () => {
expect(login.submit.isPresent).to.be.true;
});

it.always('error message should not be present', () => {
expect(login.message.isPresent).to.be.false;
});
});

describe('error for the server error', () => {
setupApplication({
disableAuth: false,
Expand Down

0 comments on commit 142ff27

Please sign in to comment.