Skip to content

Commit a26b6c8

Browse files
committed
revert vue tests back to original
1 parent 4d85ea4 commit a26b6c8

File tree

2 files changed

+7
-19
lines changed

2 files changed

+7
-19
lines changed

packages/vue/src/components/__tests__/authenticator.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ describe('authenticator', () => {
170170
});
171171

172172
it.each(routesWithComponent)('renders %s subcomponent', (route) => {
173-
let user: { username: string } | undefined = undefined;
173+
let user = undefined;
174174
const challengeName = 'SOFTWARE_TOKEN_MFA';
175175

176176
// some routes expect specific shape of user

packages/vue/src/components/__tests__/password-control.spec.ts

+6-18
Original file line numberDiff line numberDiff line change
@@ -150,30 +150,18 @@ describe('PasswordControl', () => {
150150

151151
it('toggles input field type when show password button is clicked', async () => {
152152
render(PasswordControl, {
153-
props: {
154-
name: 'password',
155-
label: 'Password',
156-
placeholder: 'Password',
157-
},
153+
global: { components },
154+
props: { name: 'password', label: 'Password' },
158155
});
159-
160-
const input = screen.getByPlaceholderText('Password');
156+
const input = screen.getByLabelText('Password');
161157
const showPasswordButton = screen.getByRole('switch');
162158

163-
// Initial state: password is hidden (type=password)
164-
expect(input.getAttribute('type')).toBe('password');
165-
expect(showPasswordButton.getAttribute('aria-checked')).toBe('false');
159+
expect(input).toHaveAttribute('type', 'password');
166160

167-
// Click the button to show password (should change to type=text)
168161
await fireEvent.click(showPasswordButton);
162+
expect(input).toHaveAttribute('type', 'text');
169163

170-
// After clicking, the password should be visible
171-
expect(input.getAttribute('type')).toBe('text');
172-
expect(showPasswordButton.getAttribute('aria-checked')).toBe('true');
173-
174-
// Click again to hide password (should change back to type=password)
175164
await fireEvent.click(showPasswordButton);
176-
expect(input.getAttribute('type')).toBe('password');
177-
expect(showPasswordButton.getAttribute('aria-checked')).toBe('false');
165+
expect(input).toHaveAttribute('type', 'password');
178166
});
179167
});

0 commit comments

Comments
 (0)