Skip to content

Commit

Permalink
push to biztek repo changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sricharan123 committed Sep 30, 2016
1 parent f943773 commit 2d69c92
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 55 deletions.
14 changes: 5 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: node_js
node_js: stable
dist: trusty
sudo: required
sudo: false
addons:
firefox: latest
sauce_connect: true
Expand All @@ -16,14 +15,11 @@ before_script:
- export PATH=$PWD/node_modules/.bin:$PATH
- bower install paper-icon-button
- bower install
- export DISPLAY=:99.0
script:
- xvfb-run wct --skip-plugin sauce
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then wct --plugin sauce --skip-plugin local; fi
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then wct --skip-plugin local; fi
env:
global:
- secure: sbxWWc+i9eCVVsQA9X/Lq85qh/pAml9rIqV1cRsyjGjAc/gdjIdq97S9IWqbl79/5z7vWwX5HOIII5JFNMcV4SB3MlKoqkuMNoJi47YmP5VkH+EyKXwExuJmI3vccumwwlg6drP1ou/ppSY0Q0tYK7zQa5RoEXCkXGLyGWvnNVPKpKCqyvWMn/2NsjuyyihlwKY3TNoxuD5ArJ4MD1ni9BNRaMiu8ofP9g6OfqHBLzaSvYpSWNrQ7CiyJdu5lWNDk7aizde9b1d0RujJxVe1B8c9EK07XU7ffWUmOREts/EVvimm0nCG1e/3/rEE67hVwXNUaEid7snW4qOlTf4Rode/jqGZBMOtGdBzyd8QPkH0+niPE5xwPocZ7NyaMgyhqDs1emlLLcXilgm5UsCrfSLY8G0QjxpxVUWW1KJwmAIpRnvjZIZph9UbTRwxhHDksFxvGc32vgI2OpQlEyR/I1+XOgsuaNn/ewmNVjXMYHnuzUGgT2jlqXmfQi0qCoNl4lPJQUMwf/uJNROacy1EqM7puLT021NeMXbGUn+oEAFF5sGV4VXnopiVt2/SXciBDU2thjL+smZ32lBugYpYnRPzfR8+xHFiJOVkvi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WuOnJyYt0Er32rnwkjCIdyG7Kfh1e/eecysGOKHsfjL0CfkaQNR99E9/TI2Sudp2hIORvSRmhcQurUfwO3vKvbyy08D4ID2iaqxoW9xUU/eshhM0b+RkQA8SkKVXu0sJ3YQTEn5SGrHlBXpOemIIqtLGBrOPKcHGDirA8hnCnQ1QZ7iQ3v/6+mM7wcgh6rQ6nT1Zfe3kCWs7RSg2plKmFJyQDBQcXaTdn03O7HOeIVz9IyQAq9KyXIZ+PDzw+ZHcc6H3kv3/dbY=
dd:
secure: RpisVxgTUt6FlaEc/yHGM+eCUcTQd3PA6fPBowDmc6jaLbzDnzUKgR9BvrQSDqDy1OIdTnCyHESFNIy+28Yb/cfKGKPe1V4HIAfr1JP8H0kG4QaBo80roFspCOxa8XuooZmuTPjdj4zzbBkLSbxSZPV0XsMH0uqr1zpssY81MkMzDI7Cq9YSc+nnoH7mOiBIx8kuR/8bL+wJlDoCNQEI5Ul2hKH3WBFI3xy8CwYoDJVnvTUODSqAi4E8Y6EI9QbyG0ydjjHRLbV7qBGT5aiMVZ4WxRPBhM+rwOHqig5c9DhkIvGA5vnIieTiwNVpCHLHDVR4I6+oPoPuK+M/1jCZ/qgPOKGuyJsbZmOoD9CKMRj3VztCGrla6vA5emUMBWMGhywqws9ye91qVMsir+U7qGGRFTvfmkBdEVsAOOWN5E+LvOM42+kJhWx4p9msxfMlI+Ft8dTo8J88P5CdyxOZuCvzWaky13OP9gyxRWX97UPGtwrsTWTl3D4o0OLvNQ7BlTUuqU0Md+t4aYJ8hXOitRo3D3qVNhlAriGFk4APLEMRHBm8Q+XmRq8QVUMF3fOefuD65qzZ5SqgscdVLwz1gw9puO1SCQ7yAHdRBJQn3MFTtH2zhCpjUG3rvMvEzQPHqsr5MF060bQ/y7vbrD9Ik9OtsTlS3XQSDWwtMSVmtCo=
113 changes: 68 additions & 45 deletions test/basic-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

<test-fixture id="pattern-validator">
<template>
<hipaa-password-input value="sriCer@234" pattern="^(?=.*\d)(?=.*[~!@#$%^*&;?.+_])(?=.*[a-z])(?=.*[A-Z]).{8,}$">
<hipaa-password-input error-message="Password should have at least 8 characters with at least one number, one lowercase, one uppercase letter, one special char(~!@#$%^*&;?.+_)" pattern="^(?=.*\d)(?=.*[~!@#$%^*&;?.+_])(?=.*[a-z])(?=.*[A-Z]).{8,}$">
</hipaa-password-input>
</template>
</test-fixture>
Expand All @@ -78,50 +78,6 @@
assert.equal(element.is, 'hipaa-password-input');
});

test('can validate using a complex regex', function() {
var input = fixture('pattern-validator');
input.value = '####@##!';
input.validate();
assert.isTrue(input.invalid, 'input is invalid');
input.value = 'Password345';
input.validate();
assert.isTrue(input.invalid, 'input is invalid');
input.value = 'password@!';
input.validate();
assert.isTrue(input.invalid, 'input is invalid');
input.value = 'passdS345#$%^6';
input.validate();
assert.isFalse(input.invalid, 'input is valid');
});

test('reveal/hide password on show password icon click', function() {
var input = fixture('show-password');
forceXIfStamp(input);

var showPasswordIcon = Polymer.dom(input.root).querySelector('paper-icon-button');
assert.equal(input.type, 'password', 'Before show password click, type equals password');

showPasswordIcon.click();
assert.equal(input.type, 'text', 'clicking on show password icon iconchanges type to text');
assert.equal(showPasswordIcon.icon, 'visibility', 'After show password click, show password icon equals visibility');

showPasswordIcon.click();
assert.equal(input.type, 'password', 'clicking on show password icon again changes type to password');
assert.equal(showPasswordIcon.icon, 'visibility-off', 'clicking on show password icon again changes show password icon to visibility-off');
});

suite('validation', function() {
test('invalid attribute updated after calling validate()', function() {
var input = fixture('required-no-auto-validate');
forceXIfStamp(input);
input.validate();
var error = Polymer.dom(input.root).querySelector('paper-input-error');
assert.ok(error, 'paper-input-error exists');
assert.notEqual(getComputedStyle(error).display, 'none', 'error is not display:none');
assert.isTrue(input.invalid, 'invalid is true');
});
});

test('invalid attribute updated after calling validate()', function() {
var input = fixture('required-no-auto-validate');
forceXIfStamp(input);
Expand Down Expand Up @@ -160,6 +116,73 @@
assert.equal(basic.value, '');
});
});

suite('validate the password', function() {
test('sets invalid to False if password is valid', function() {
var input = fixture('pattern-validator');
input.value = 'passdS345#$%^6';
input.validate();
assert.isFalse(input.invalid, 'input is valid');
});

test('sets invalid to true if password is invalid', function() {
var input = fixture('pattern-validator');
input.value = '####@##!';
input.validate();
assert.isTrue(input.invalid, 'input is invalid');

input.value = 'Password345';
input.validate();
assert.isTrue(input.invalid, 'input is invalid');

});

});

suite('password input field to test', function() {
test('show type default password **** for first time', function() {
var input = fixture('show-password');
forceXIfStamp(input);
var showPasswordIcon = Polymer.dom(input.root).querySelector('paper-icon-button');
assert.equal(input.type, 'password', 'Before show password click, type equals password');
});

suite('password icon test when clicks', function() {

test('show the text if visibility icon is click', function() {
var input = fixture('show-password');
forceXIfStamp(input);
var showPasswordIcon = Polymer.dom(input.root).querySelector('paper-icon-button');
showPasswordIcon.click();
assert.equal(input.type, 'text', 'clicking on show password icon iconchanges type to text');
assert.equal(showPasswordIcon.icon, 'visibility', 'After show password click, show password icon equals visibility');

});

test('hide the text if visibility-off icon is click', function() {
var input = fixture('show-password');
forceXIfStamp(input);
var showPasswordIcon = Polymer.dom(input.root).querySelector('paper-icon-button');
showPasswordIcon.click();
showPasswordIcon.click();
assert.equal(input.type, 'password', 'clicking on show password icon iconchanges type to password');
assert.equal(showPasswordIcon.icon, 'visibility-off', 'After show password click, show password icon equals visibility-off');

});
});

suite('validation', function() {

test('invalid attribute updated after calling validate()', function() {
var input = fixture('required-no-auto-validate');
forceXIfStamp(input);
input.validate();
var error = Polymer.dom(input.root).querySelector('paper-input-error');
assert.ok(error, 'paper-input-error exists');
assert.notEqual(getComputedStyle(error).display, 'none', 'error is not display:none');
assert.isTrue(input.invalid, 'invalid is true');
});
});
</script>
</body>

Expand Down
1 change: 0 additions & 1 deletion wct.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"plugins": {
"sauce": {
"disabled": true,
"browsers": [{
"browserName": "microsoftedge",
"platform": "Windows 10",
Expand Down

0 comments on commit 2d69c92

Please sign in to comment.