Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit dfccca2

Browse files
Test show/hide credentials button
1 parent 0870a35 commit dfccca2

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/views/credential-dialog.test.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,24 @@ describe('CredentialDialog', function() {
8585
assert.isFalse(wrapper.find('.github-CredentialDialog-remember').exists());
8686
});
8787
});
88+
89+
describe('show password', function() {
90+
it('sets the passwords input type to "text" on the first click', function() {
91+
wrapper = mount(app);
92+
93+
wrapper.find('.github-DialogLabelButton').simulate('click');
94+
95+
const passwordInput = wrapper.find('.github-CredentialDialog-Password');
96+
assert.equal(passwordInput.prop('type'), 'text');
97+
});
98+
99+
it('sets the passwords input type back to "password" on the second click', function() {
100+
wrapper = mount(app);
101+
102+
wrapper.find('.github-DialogLabelButton').simulate('click').simulate('click');
103+
104+
const passwordInput = wrapper.find('.github-CredentialDialog-Password');
105+
assert.equal(passwordInput.prop('type'), 'password');
106+
});
107+
});
88108
});

0 commit comments

Comments
 (0)