Skip to content

Commit 2e57773

Browse files
committed
feat: add LICENCE and add some tests
1 parent 07f1a4e commit 2e57773

File tree

4 files changed

+39
-1
lines changed

4 files changed

+39
-1
lines changed

LICENCE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 vicmans, joelcoronah
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ import { NgxInputCounterModule } from 'ngx-input-counter';
3333

3434
Use in your components
3535

36+
```html
3637
<ngx-input-counter [(ngModel)]="qty"></ngx-input-counter>
37-
38+
```
3839

3940
## Development server
4041

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"watch": "ng build --watch --configuration development",
1818
"test": "ng test"
1919
},
20+
"license": "MIT",
2021
"private": true,
2122
"dependencies": {
2223
"@angular/animations": "^15.1.0",

projects/ngx-input-counter/src/lib/ngx-input-counter.component.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,19 @@ describe('NgxInputCounterComponent', () => {
2020
it('should create', () => {
2121
expect(component).toBeTruthy();
2222
});
23+
24+
it('should have default values', () => {
25+
expect(component.value).toEqual(0);
26+
expect(component.step).toBe(1);
27+
expect(component.min).toBe(-Infinity);
28+
expect(component.max).toBe(Infinity);
29+
expect(component.disabled).toBeFalse();
30+
});
31+
32+
it('should add 1 to value when click plus button', () => {
33+
const plusButton = fixture.debugElement.nativeElement.querySelector('.ngx-input-counter-button:last-of-type');
34+
plusButton.click();
35+
fixture.detectChanges();
36+
expect(component.value).toBe(1);
37+
})
2338
});

0 commit comments

Comments
 (0)