Skip to content

Commit

Permalink
fix(*): lint bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Arash-Azarpoor authored Aug 17, 2024
1 parent 6bbb6c1 commit 4b0bf3b
Show file tree
Hide file tree
Showing 14 changed files with 61 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ COPY . .

RUN npm run lint

RUN ng test --watch=false --browsers=ChromeHeadlessNoSandbox
RUN ng test --watch=false --browsers=ChromeHeadless

RUN npm run build --configuration=production

Expand Down
3 changes: 0 additions & 3 deletions src/app/components/add-user/add-user.component.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import {
Component,
ElementRef,
EventEmitter,
Input,
Output,
QueryList,
ViewChildren,
} from '@angular/core';
import {FormBuilder, FormGroup, Validators, ReactiveFormsModule, FormsModule} from '@angular/forms';
import { NzModalModule } from 'ng-zorro-antd/modal';
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/edit-password/edit-password.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ <h2 class="edit-profile-container__main__title">
<div
class="edit-profile-container__main__form__field-container__input-container__label-group"
>
<label
<p
class="edit-profile-container__main__form__field-container__input-container__label"
>
{{ control.placeholder }}
</label>
</p>
<p
*ngIf="
passwordForm.get(control.name)?.touched &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { NgIf, NgFor, NgClass } from '@angular/common';
})
export class EditPasswordComponent {
protected passwordForm: FormGroup;
protected isSubmitted: boolean = false;
protected isSubmitted = false;
protected formControls: {
name: string;
type: string;
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/edit-profile/edit-profile.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ <h2 class="edit-profile-container__main__title">
<div
class="edit-profile-container__main__form__field-container__input-container__label-group"
>
<label
<p
class="edit-profile-container__main__form__field-container__input-container__label"
>
{{ control.placeholder }}
</label>
</p>
<p
*ngIf="
userForm.get(control.name)?.touched &&
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { EditProfileComponent } from './edit-profile.component';
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
import { provideHttpClient } from '@angular/common/http';

describe('EditProfileComponent', () => {
let component: EditProfileComponent;
let fixture: ComponentFixture<EditProfileComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [EditProfileComponent]
imports: [EditProfileComponent],
providers: [provideAnimationsAsync(), provideHttpClient()]
})
.compileComponents();

Expand Down
4 changes: 2 additions & 2 deletions src/app/components/edit-profile/edit-profile.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import { NzSelectModule } from 'ng-zorro-antd/select';
})
export class EditProfileComponent {
userForm: FormGroup;
isSubmitted: boolean = false;
listOfOption: Array<{ label: string; value: string }> = [
isSubmitted = false;
listOfOption: { label: string; value: string }[] = [
{ label: 'System Administrator', value: 'System Administrator' },
{ label: 'Data Manager', value: 'Data Manager' },
{ label: 'Analyst', value: 'Analyst' }
Expand Down
5 changes: 4 additions & 1 deletion src/app/components/edit-user/edit-user.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { EditUserComponent } from './edit-user.component';
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
import { provideHttpClient } from '@angular/common/http';

describe('EditUserComponent', () => {
let component: EditUserComponent;
let fixture: ComponentFixture<EditUserComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [EditUserComponent]
imports: [EditUserComponent],
providers: [provideAnimationsAsync(), provideHttpClient()]
})
.compileComponents();

Expand Down
11 changes: 10 additions & 1 deletion src/app/components/sidebar/sidebar.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { SidebarComponent } from './sidebar.component';
import { NZ_ICONS, NzIconService } from 'ng-zorro-antd/icon';
import { DashboardOutline, NodeIndexOutline, TeamOutline } from '@ant-design/icons-angular/icons';

describe('SidebarComponent', () => {
let component: SidebarComponent;
let fixture: ComponentFixture<SidebarComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [SidebarComponent]
imports: [SidebarComponent],
providers: [
NzIconService,
{
provide: NZ_ICONS,
useValue: [NodeIndexOutline, TeamOutline, DashboardOutline]
}
]
})
.compileComponents();

Expand Down
2 changes: 1 addition & 1 deletion src/app/components/sign-in/sign-in.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('SignInComponent', () => {
fixture.detectChanges();

loginService = TestBed.inject(LoginService) as jasmine.SpyObj<LoginService>;
loginService.login.and.returnValue(of({ success: true }));
loginService.login.and.returnValue(of({ message: 'true' }));
});

it('should create', () => {
Expand Down
11 changes: 10 additions & 1 deletion src/app/components/users-table/users-table.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { UsersTableComponent } from './users-table.component';
import { NZ_ICONS, NzIconService } from 'ng-zorro-antd/icon';
import { UserAddOutline } from '@ant-design/icons-angular/icons';

describe('UsersTableComponent', () => {
let component: UsersTableComponent;
let fixture: ComponentFixture<UsersTableComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [UsersTableComponent]
imports: [UsersTableComponent],
providers: [
NzIconService,
{
provide: NZ_ICONS,
useValue: [UserAddOutline]
}
]
})
.compileComponents();

Expand Down
15 changes: 12 additions & 3 deletions src/app/page/auth/auth.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AuthComponent } from './auth.component';
import { HttpClient, HttpHandler } from '@angular/common/http';
import { NZ_ICONS, NzIconService } from 'ng-zorro-antd/icon';
import { NodeIndexOutline } from '@ant-design/icons-angular/icons';

describe('AuthComponent', () => {
let component: AuthComponent;
Expand All @@ -9,9 +11,16 @@ describe('AuthComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [AuthComponent],
providers: [HttpClient , HttpHandler]
})
.compileComponents();
providers: [
HttpClient,
HttpHandler,
NzIconService,
{
provide: NZ_ICONS,
useValue: [NodeIndexOutline],
},
],
}).compileComponents();

fixture = TestBed.createComponent(AuthComponent);
component = fixture.componentInstance;
Expand Down
4 changes: 2 additions & 2 deletions src/app/page/auth/auth.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { SignInComponent } from '../../components/sign-in/sign-in.component';
import { NgParticlesService, NgxParticlesModule } from '@tsparticles/angular';
import { Container, IOptions, Engine } from '@tsparticles/engine';
Expand All @@ -12,7 +12,7 @@ import { NzIconModule } from 'ng-zorro-antd/icon';
templateUrl: './auth.component.html',
styleUrl: './auth.component.scss',
})
export class AuthComponent {
export class AuthComponent implements OnInit {
id = 'tsparticles';
config: IOptions = {
autoPlay: true,
Expand Down
11 changes: 10 additions & 1 deletion src/app/page/dashboard/dashboard.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { DashboardComponent } from './dashboard.component';
import { NZ_ICONS, NzIconService } from 'ng-zorro-antd/icon';
import { DashboardOutline, NodeIndexOutline, TeamOutline, UserAddOutline } from '@ant-design/icons-angular/icons';

describe('DashboardComponent', () => {
let component: DashboardComponent;
let fixture: ComponentFixture<DashboardComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [DashboardComponent]
imports: [DashboardComponent],
providers: [
NzIconService,
{
provide: NZ_ICONS,
useValue: [NodeIndexOutline, UserAddOutline, TeamOutline, DashboardOutline],
},
]
})
.compileComponents();

Expand Down

0 comments on commit 4b0bf3b

Please sign in to comment.