Skip to content

Commit 945f4e1

Browse files
committed
Some more fun
1 parent 3320d0e commit 945f4e1

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@
44
[![npm version](https://img.shields.io/npm/v/@almothafar/angular-signature-pad.svg)](https://www.npmjs.com/package/@almothafar/angular-signature-pad)
55
[![npm license](https://img.shields.io/npm/l/@almothafar/angular-signature-pad.svg)](https://www.npmjs.com/package/@almothafar/angular-signature-pad)
66
[![GitHub issues](https://img.shields.io/github/issues/almothafar/angular-signature-pad.svg)](https://github.com/almothafar/angular-signature-pad/issues)
7+
[![Angular 20](https://img.shields.io/badge/Angular-20-DD0031?logo=angular)](https://angular.io/)
78

89

910
Angular component for [szimek/signature_pad](https://www.npmjs.com/package/signature_pad).
1011

12+
**✨ Now supports Angular 20!** Built with standalone components and modern Angular best practices.
13+
1114
## Install
1215

1316
```shell

projects/angular-signature-pad/src/lib/angular-signature-pad.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('AngularSignaturePadComponent', () => {
88

99
beforeEach(async () => {
1010
await TestBed.configureTestingModule({
11-
declarations: [SignaturePadComponent],
11+
imports: [SignaturePadComponent],
1212
}).compileComponents();
1313
});
1414

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
22

3-
import 'zone.js/dist/zone';
4-
import 'zone.js/dist/zone-testing';
3+
import 'zone.js';
4+
import 'zone.js/testing';
55
import { getTestBed } from '@angular/core/testing';
6-
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
6+
import {
7+
BrowserDynamicTestingModule,
8+
platformBrowserDynamicTesting,
9+
} from '@angular/platform-browser-dynamic/testing';
710

811
// First, initialize the Angular testing environment.
912
getTestBed().initTestEnvironment(
1013
BrowserDynamicTestingModule,
11-
platformBrowserDynamicTesting(), {
12-
teardown: { destroyAfterEach: false }
13-
}
14+
platformBrowserDynamicTesting(),
15+
{
16+
teardown: { destroyAfterEach: true }
17+
}
1418
);

projects/demo/src/app/app.component.spec.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,15 @@ describe('AppComponent', () => {
1414
expect(app).toBeTruthy();
1515
});
1616

17-
it(`should have the 'demo' title`, () => {
17+
it('should have signature field items', () => {
1818
const fixture = TestBed.createComponent(AppComponent);
1919
const app = fixture.componentInstance;
20-
expect(app.title).toEqual('demo');
20+
expect(app.items.length).toBeGreaterThan(0);
2121
});
2222

23-
it('should render title', () => {
23+
it('should have titles array', () => {
2424
const fixture = TestBed.createComponent(AppComponent);
25-
fixture.detectChanges();
26-
const compiled = fixture.nativeElement as HTMLElement;
27-
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, demo');
25+
const app = fixture.componentInstance;
26+
expect(app.titles.length).toEqual(app.items.length);
2827
});
2928
});

0 commit comments

Comments
 (0)