@openmrs/esm-login-app 8.0.1-pre.3549 → 8.0.1-pre.3552
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +3 -3
- package/dist/8450.js +1 -1
- package/dist/8450.js.map +1 -1
- package/dist/main.js +3 -3
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-login-app.js +3 -3
- package/dist/openmrs-esm-login-app.js.buildmanifest.json +7 -7
- package/dist/routes.json +1 -1
- package/package.json +3 -3
- package/src/login/login.component.tsx +28 -16
- package/src/login/login.scss +11 -0
- package/src/login/login.test.tsx +32 -3
package/src/login/login.test.tsx
CHANGED
|
@@ -172,7 +172,7 @@ describe('Login', () => {
|
|
|
172
172
|
expect(loginButton).toBeInTheDocument();
|
|
173
173
|
});
|
|
174
174
|
|
|
175
|
-
it('should
|
|
175
|
+
it('should render password field hidden but present for autofill when showPasswordOnSeparateScreen config is true (default)', async () => {
|
|
176
176
|
mockUseConfig.mockReturnValue({
|
|
177
177
|
...mockConfig,
|
|
178
178
|
});
|
|
@@ -187,12 +187,14 @@ describe('Login', () => {
|
|
|
187
187
|
|
|
188
188
|
const usernameInput = screen.queryByRole('textbox', { name: /username/i });
|
|
189
189
|
const continueButton = screen.queryByRole('button', { name: /Continue/i });
|
|
190
|
-
const passwordInput = screen.queryByLabelText(
|
|
190
|
+
const passwordInput = screen.queryByLabelText(/^password$/i);
|
|
191
191
|
const loginButton = screen.queryByRole('button', { name: /log in/i });
|
|
192
192
|
|
|
193
193
|
expect(usernameInput).toBeInTheDocument();
|
|
194
194
|
expect(continueButton).toBeInTheDocument();
|
|
195
|
-
expect(passwordInput).
|
|
195
|
+
expect(passwordInput).toBeInTheDocument();
|
|
196
|
+
expect(passwordInput).toHaveAttribute('aria-hidden', 'true');
|
|
197
|
+
expect(passwordInput).toHaveAttribute('tabIndex', '-1');
|
|
196
198
|
expect(loginButton).not.toBeInTheDocument();
|
|
197
199
|
});
|
|
198
200
|
|
|
@@ -283,4 +285,31 @@ describe('Login', () => {
|
|
|
283
285
|
|
|
284
286
|
expect(usernameInput).toHaveFocus();
|
|
285
287
|
});
|
|
288
|
+
|
|
289
|
+
it('should make password input visible and accessible after continuing from username step', async () => {
|
|
290
|
+
const user = userEvent.setup();
|
|
291
|
+
mockUseConfig.mockReturnValue({
|
|
292
|
+
...mockConfig,
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
renderWithRouter(
|
|
296
|
+
Login,
|
|
297
|
+
{},
|
|
298
|
+
{
|
|
299
|
+
route: '/login',
|
|
300
|
+
},
|
|
301
|
+
);
|
|
302
|
+
|
|
303
|
+
const usernameInput = screen.getByRole('textbox', { name: /username/i });
|
|
304
|
+
const continueButton = screen.getByRole('button', { name: /Continue/i });
|
|
305
|
+
|
|
306
|
+
await user.type(usernameInput, 'testuser');
|
|
307
|
+
await user.click(continueButton);
|
|
308
|
+
|
|
309
|
+
const passwordInput = screen.getByLabelText(/^password$/i);
|
|
310
|
+
|
|
311
|
+
// Password should now be visible and accessible
|
|
312
|
+
expect(passwordInput).toHaveAttribute('aria-hidden', 'false');
|
|
313
|
+
expect(passwordInput).toHaveAttribute('tabIndex', '0');
|
|
314
|
+
});
|
|
286
315
|
});
|