Browse Source

update

pull/17267/head
Sinan997 3 years ago
parent
commit
65512dd433
  1. 6
      docs/en/UI/Angular/CapsLock.directive.md
  2. 1
      npm/ng-packs/packages/core/src/lib/tests/capsLock.directive.spec.ts
  3. 6
      npm/ng-packs/packages/core/src/lib/tests/show-password-directive.spec.ts

6
docs/en/UI/Angular/CapsLock.directive.md

@ -39,7 +39,7 @@ See an example usage:
<div class="d-flex flex-column">
<label>Password</label>
<input (abpCapsLock)="capsLock = $event"/>
<i *ngIf='capsLock'>icon</i>
<i *ngIf="capsLock">icon</i>
</div>
`
})
@ -59,10 +59,10 @@ import { TrackCapsLockDirective } from '@abp/ng.core'
<div class="d-flex flex-column">
<label>Password</label>
<input (abpCapsLock)="capsLock = $event"/>
<i *ngIf='capsLock'>icon</i>
<i *ngIf="capsLock">icon</i>
</div>
`,
imports: [ TrackCapsLockDirective ]
imports: [TrackCapsLockDirective]
})
export class StandaloneComponent{
capsLock = false;

1
npm/ng-packs/packages/core/src/lib/tests/capsLock.directive.spec.ts

@ -28,7 +28,6 @@ describe('TrackCapsLockDirective',()=>{
des = fixture.debugElement.queryAll(By.directive(TrackCapsLockDirective));
});
// tests
test.each(['keydown','keyup'])('is %p works when press capslock and is emit status', (eventName) => {
const event = new KeyboardEvent(eventName, {
key: 'CapsLock',

6
npm/ng-packs/packages/core/src/lib/tests/show-password-directive.spec.ts

@ -27,19 +27,15 @@ describe('ShowPasswordDirective',()=>{
imports: [ TestComponent ]
}).createComponent(TestComponent)
fixture.detectChanges(); // initial binding
fixture.detectChanges();
// all elements with an attached HighlightDirective
des = fixture.debugElement.queryAll(By.directive(ShowPasswordDirective));
// all inputs includes nondirective
desAll = fixture.debugElement.queryAll(By.all());
// the input without the ShowPasswordDirective
bareInput = fixture.debugElement.query(By.css('input:not([abpShowPassword])'));
})
// tests
it('should have three input has ShowPasswordDirective elements', () => {
expect(des.length).toBe(3);
});

Loading…
Cancel
Save