Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
{
"files": ["src/**/*.spec.ts", "src/**/*.d.ts"],
"parserOptions": {
"project": "./src/tsconfig.spec.json"
"project": "./tsconfig.spec.json"
},
"extends": ["plugin:jasmine/recommended"],
"plugins": ["jasmine"],
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- [Tech Stack](#tech-stack)
- [Features](#features)
- [Installation](#installation)
- [Developers](#Developers):rocket:
- [Developers](#Developers) :rocket:
- [Support](#support)
- [Used By](#used-by)
- [FAQ](#faq)
Expand All @@ -29,7 +29,7 @@ https://wapa.netlify.app/

**Client:** Angular, SCSS, TypeScript

**Server:** Nextjs, PostgreSQL
**Server:** Next.js, PostgreSQL

## Features

Expand All @@ -46,7 +46,7 @@ A short list of additional features implemented in our project:

```shell
git clone https://github.com/PoMaKoM-RSTeam/Project-management.git
cd intern-angular
cd rsschool-angular
```

### Install npm packages
Expand Down
11 changes: 2 additions & 9 deletions src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,11 @@ describe('AppComponent', () => {
expect(app).toBeTruthy();
});

it(`should have as title 'project-management'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;

expect(app.title).toEqual('project-management');
});

it('should render title', () => {
it('should render', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;

expect(compiled.querySelector('.content span')?.textContent).toContain('project-management app is running!');
expect(compiled.querySelector('.main-container')).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { HttpClient } from '@angular/common/http';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatDialogModule } from '@angular/material/dialog';
import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { NZ_CONFIG } from 'ng-zorro-antd/core/config';
import { NzMessageService } from 'ng-zorro-antd/message';

import { AuthButtonComponent } from './auth-button.component';

Expand All @@ -9,6 +15,8 @@ describe('AuthButtonComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [AuthButtonComponent],
imports: [RouterTestingModule, BrowserDynamicTestingModule, MatDialogModule],
providers: [{ provide: HttpClient, useValue: {} }, { provide: NZ_CONFIG, useValue: {} }, NzMessageService],
}).compileComponents();
});

Expand Down
6 changes: 4 additions & 2 deletions src/app/board/board-item/board-item.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';

import { BoardItemComponent } from './board-item.component';

Expand All @@ -9,16 +11,16 @@ describe('BoardItemComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [BoardItemComponent],
imports: [RouterTestingModule, HttpClientTestingModule],
}).compileComponents();
});

beforeEach(() => {
fixture = TestBed.createComponent(BoardItemComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
expect(component)?.toBeTruthy();
});
});
3 changes: 3 additions & 0 deletions src/app/board/board/board.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';

import { BoardComponent } from './board.component';

Expand All @@ -9,6 +11,7 @@ describe('BoardComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [BoardComponent],
imports: [RouterTestingModule, HttpClientTestingModule],
}).compileComponents();
});

Expand Down
3 changes: 1 addition & 2 deletions src/app/board/comment-item/comment-item.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ describe('CommentItemComponent', () => {
beforeEach(() => {
fixture = TestBed.createComponent(CommentItemComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
expect(component)?.toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';

import { EditColumnTitleComponent } from './edit-column-title.component';

Expand All @@ -9,6 +11,7 @@ describe('EditColumnTitleComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [EditColumnTitleComponent],
imports: [RouterTestingModule, HttpClientTestingModule],
}).compileComponents();
});

Expand Down
3 changes: 3 additions & 0 deletions src/app/board/header/header.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';

import { HeaderComponent } from './header.component';

Expand All @@ -9,6 +11,7 @@ describe('HeaderComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [HeaderComponent],
imports: [RouterTestingModule, HttpClientTestingModule],
}).compileComponents();
});

Expand Down
7 changes: 7 additions & 0 deletions src/app/confirm/confirm/confirm.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatDialogModule, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';

import { ConfirmComponent } from './confirm.component';

Expand All @@ -9,6 +11,11 @@ describe('ConfirmComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ConfirmComponent],
imports: [MatDialogModule, BrowserDynamicTestingModule],
providers: [
{ provide: MatDialogRef, useValue: {} },
{ provide: MAT_DIALOG_DATA, useValue: [] },
],
}).compileComponents();
});

Expand Down
9 changes: 9 additions & 0 deletions src/app/core/components/header/header.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { HttpClient } from '@angular/common/http';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatDialogModule } from '@angular/material/dialog';
import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { NZ_CONFIG } from 'ng-zorro-antd/core/config';
import { NzMessageService } from 'ng-zorro-antd/message';

import { HeaderComponent } from './header.component';

Expand All @@ -9,6 +16,8 @@ describe('HeaderComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [HeaderComponent],
imports: [RouterTestingModule, BrowserDynamicTestingModule, HttpClientTestingModule, MatDialogModule],
providers: [{ provide: HttpClient, useValue: {} }, { provide: NZ_CONFIG, useValue: {} }, NzMessageService],
}).compileComponents();
});

Expand Down
5 changes: 5 additions & 0 deletions src/app/core/components/nav/nav.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { HttpClient } from '@angular/common/http';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
import { RouterTestingModule } from '@angular/router/testing';

import { NavComponent } from './nav.component';

Expand All @@ -9,6 +12,8 @@ describe('NavComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [NavComponent],
imports: [RouterTestingModule, BrowserDynamicTestingModule],
providers: [{ provide: HttpClient, useValue: {} }],
}).compileComponents();
});

Expand Down
3 changes: 2 additions & 1 deletion src/app/core/pages/about-page/about-page.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { SearchPipe } from '../../pipes/search/search.pipe';

import { AboutPageComponent } from './about-page.component';

Expand All @@ -8,7 +9,7 @@ describe('AboutPageComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [AboutPageComponent],
declarations: [AboutPageComponent, SearchPipe],
}).compileComponents();
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { HttpClient } from '@angular/common/http';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
import { RouterTestingModule } from '@angular/router/testing';

import { WelcomePageComponent } from './welcome-page.component';

Expand All @@ -9,6 +12,8 @@ describe('WelcomePageComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [WelcomePageComponent],
imports: [BrowserDynamicTestingModule, RouterTestingModule],
providers: [{ provide: HttpClient, useValue: {} }],
}).compileComponents();
});

Expand Down
7 changes: 7 additions & 0 deletions src/app/core/pipes/search/search.pipe.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { TestBed } from '@angular/core/testing';
import { SearchPipe } from './search.pipe';

describe('SearchPipe', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [SearchPipe],
}).compileComponents();
});

it('create an instance', () => {
const pipe = new SearchPipe();

Expand Down
7 changes: 7 additions & 0 deletions src/app/dialog/dialog-body/dialog-body.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatDialogModule, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';

import { DialogBodyComponent } from './dialog-body.component';

Expand All @@ -9,6 +11,11 @@ describe('DialogBodyComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [DialogBodyComponent],
imports: [MatDialogModule, BrowserDynamicTestingModule],
providers: [
{ provide: MatDialogRef, useValue: {} },
{ provide: MAT_DIALOG_DATA, useValue: [] },
],
}).compileComponents();
});

Expand Down
12 changes: 9 additions & 3 deletions src/app/dialog/dialog/dialog.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { MatDialogModule, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
import { DialogComponent } from './dialog.component';

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

beforeEach(async () => {
await TestBed.configureTestingModule({
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [DialogComponent],
imports: [MatDialogModule, BrowserDynamicTestingModule],
providers: [
{ provide: MatDialogRef, useValue: {} },
{ provide: MAT_DIALOG_DATA, useValue: [] },
],
}).compileComponents();
});

Expand Down
27 changes: 20 additions & 7 deletions src/app/profile/profile.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import { HttpClient } from '@angular/common/http';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatDialogModule, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { NZ_CONFIG } from 'ng-zorro-antd/core/config';
import { NzMessageService } from 'ng-zorro-antd/message';
import { AuthService } from '../auth/services/auth.service';
import { UsersAPIService } from '../services/users-api.service';

import { ProfileComponent } from './profile.component';

Expand All @@ -9,16 +17,21 @@ describe('ProfileComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ProfileComponent],
imports: [RouterTestingModule, BrowserDynamicTestingModule, MatDialogModule],
providers: [
{ provide: HttpClient, useValue: {} },
{ provide: AuthService, useValue: {} },
{ provide: UsersAPIService, useValue: {} },
{ provide: NZ_CONFIG, useValue: {} },
{ provide: MAT_DIALOG_DATA, useValue: [] },
NzMessageService,
],
}).compileComponents();
});

beforeEach(() => {
fixture = TestBed.createComponent(ProfileComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
const profile = 'Profile created';

expect(profile).toEqual('Profile created');
});
});
3 changes: 3 additions & 0 deletions src/app/search/search.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';

import { SearchComponent } from './search.component';

Expand All @@ -9,6 +11,7 @@ describe('SearchComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [SearchComponent],
imports: [RouterTestingModule, HttpClientTestingModule],
}).compileComponents();
});

Expand Down
11 changes: 10 additions & 1 deletion src/app/services/auth-api.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
import { HttpClient } from '@angular/common/http';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { TestBed } from '@angular/core/testing';
import { MatDialogModule } from '@angular/material/dialog';
import { RouterTestingModule } from '@angular/router/testing';
import { NZ_CONFIG } from 'ng-zorro-antd/core/config';
import { NzMessageService } from 'ng-zorro-antd/message';

import { AuthAPIService } from './auth-api.service';

describe('AuthAPIService', () => {
let service: AuthAPIService;

beforeEach(() => {
TestBed.configureTestingModule({});
TestBed.configureTestingModule({
imports: [RouterTestingModule, HttpClientTestingModule, MatDialogModule],
providers: [{ provide: HttpClient, useValue: {} }, { provide: NZ_CONFIG, useValue: {} }, NzMessageService],
}).compileComponents();
service = TestBed.inject(AuthAPIService);
});

Expand Down
Loading