Skip to content

Commit a8f5063

Browse files
committed
test(package): minor changes in the specs
1 parent 81c0df8 commit a8f5063

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

src/module/component/mat-password-strength-info/mat-password-strength-info.component.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {MatPasswordStrengthInfoComponent} from './mat-password-strength-info.com
44
import {MatCardModule, MatIconModule} from '@angular/material';
55
import {MatPasswordStrengthComponent} from '../mat-password-strength/mat-password-strength.component';
66
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
7+
import {By} from '@angular/platform-browser';
78

89
describe('NgxMaterialPasswordStrengthInfoComponent', () => {
910
let component: MatPasswordStrengthInfoComponent;
@@ -36,4 +37,14 @@ describe('NgxMaterialPasswordStrengthInfoComponent', () => {
3637
it('should create', () => {
3738
expect(component).toBeTruthy();
3839
});
40+
41+
it('should the input password component be defined', () => {
42+
expect(component.passwordComponent).toBeDefined();
43+
});
44+
45+
it('should render the appropriate div', () => {
46+
const div = fixture.debugElement.query(By.all());
47+
48+
console.log('div:', div);
49+
});
3950
});

src/module/component/mat-password-strength/mat-password-strength.component.spec.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ describe('PasswordStrengthComponent', () => {
102102
const testChars = ['A', '1', 'a', '.'];
103103
testChars.forEach(char => {
104104
component.password = char;
105-
console.log('char = ', char);
105+
// console.log('char = ', char);
106106
component.calculatePasswordStrength();
107107
expect(component.strength).toBe(20);
108108
expect(component.color).toBe(Colors.warn);
@@ -121,10 +121,10 @@ describe('PasswordStrengthComponent', () => {
121121
() => {
122122
const charsList = ['a', 'A', '1', '!'];
123123
const combinations = generator.loadCombinationList(charsList, 2, 2, true);
124-
console.log('combinations = ', combinations);
124+
// console.log('combinations = ', combinations);
125125
combinations.forEach(combination => {
126126
component.password = combination;
127-
console.log('combination = ', combination);
127+
// console.log('combination = ', combination);
128128
component.calculatePasswordStrength();
129129
expect(component.strength).toBe(40);
130130
expect(component.color).toBe(Colors.accent);
@@ -135,11 +135,11 @@ describe('PasswordStrengthComponent', () => {
135135
() => {
136136
const charsList = ['a', 'A', '9', '!', '123456'];
137137
const combinations = generator.loadCombinationList(charsList, 3, 3, true);
138-
console.log('combinations = ', combinations);
138+
// console.log('combinations = ', combinations);
139139

140140
combinations.forEach(combination => {
141141
const isCharDuplicate = new RegExp(/^.*(.).*\1.*$/);
142-
console.log('repeats = ', isCharDuplicate.test(combination), ' for --> ', combination);
142+
// console.log('repeats = ', isCharDuplicate.test(combination), ' for --> ', combination);
143143
if (!isCharDuplicate.test(combination)) {
144144
component.password = combination;
145145
component.calculatePasswordStrength();
@@ -153,11 +153,11 @@ describe('PasswordStrengthComponent', () => {
153153
() => {
154154
const charsList = ['a', 'A', '9', '!', 'bcdef'];
155155
const combinations = generator.loadCombinationList(charsList, 4, 4, true);
156-
console.log('combinations = ', combinations);
156+
// console.log('combinations = ', combinations);
157157

158158
combinations.forEach(combination => {
159159
const isCharDuplicate = new RegExp(/^.*(.).*\1.*$/);
160-
console.log('repeats = ', isCharDuplicate.test(combination), ' for --> ', combination);
160+
// console.log('repeats = ', isCharDuplicate.test(combination), ' for --> ', combination);
161161
if (!isCharDuplicate.test(combination)) {
162162
component.password = combination;
163163
component.calculatePasswordStrength();
@@ -171,11 +171,11 @@ describe('PasswordStrengthComponent', () => {
171171
() => {
172172
const charsList = ['a', 'A', '9', '!', 'bcdef'];
173173
const combinations = generator.loadCombinationList(charsList, 5, 5, true);
174-
console.log('combinations = ', combinations);
174+
// console.log('combinations = ', combinations);
175175

176176
combinations.forEach(combination => {
177177
const isCharDuplicate = new RegExp(/^.*(.).*\1.*$/);
178-
console.log('repeats = ', isCharDuplicate.test(combination), ' for --> ', combination);
178+
// console.log('repeats = ', isCharDuplicate.test(combination), ' for --> ', combination);
179179
if (!isCharDuplicate.test(combination)) {
180180
component.password = combination;
181181
component.calculatePasswordStrength();

0 commit comments

Comments
 (0)