-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI tesztek #19
UI tesztek #19
Conversation
A cypress beállítása közben az eredeti program nem tudott lefutni, így visszaállítottam a működő programot
teszt lefuttatása, sok hibát tapasztaltam, amik alapból benne voltak. Ezek javításának elkezdése, illetve egy új teszt kipróbálása.
Az automatikusan létrejött tesztek, átnézése, kitörlése
Az első tesztek, amik végre jól működnek
Próbáltam az összes componens valamennyi funkcióját letesztelni
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kérlek javítsd ki ezeket az apró problémákat.
import { DatasetListComponent } from './dataset-list.component'; | ||
import { ActivatedRoute, convertToParamMap, Router } from '@angular/router'; | ||
import { of, throwError } from 'rxjs'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import: throwError
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kijavítva!
import { ActivatedRoute, convertToParamMap, Router } from '@angular/router'; | ||
import { of, throwError } from 'rxjs'; | ||
import { DatasetService } from '../dataset.service'; | ||
import { MatDialogModule, MatDialog, MatDialogRef } from '@angular/material/dialog'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import: MatDialog, MatDialogRef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Javítva!
import { MatToolbarModule } from '@angular/material/toolbar'; | ||
import { MatIconModule } from '@angular/material/icon'; | ||
import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations'; | ||
import { PopUpWindowComponent } from '../pop-up-window/pop-up-window.component'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import: PopUpWindowComponent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Javítva!
|
||
beforeEach(waitForAsync(() => { | ||
mockDatasetService = jasmine.createSpyObj('DatasetService', ['getDatasetForResource']); | ||
mockRouter = jasmine.createSpyObj('Router', ['navigate']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nem használod ezek után sehol, el lehet távolítani a mockRoutert innen és a 21-es sorból is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Javítva
import { MatFormFieldModule } from '@angular/material/form-field'; | ||
import { MatCheckboxModule } from '@angular/material/checkbox'; | ||
import { MatButtonModule } from '@angular/material/button'; | ||
import { HttpClient, HttpClientModule } from '@angular/common/http'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import: HttpClient
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
javítva
@@ -1,23 +1,85 @@ | |||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | |||
|
|||
import { ReactiveFormsModule } from '@angular/forms'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import: ReactiveFormsModule
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
javítva
import { MatIconModule } from '@angular/material/icon'; | ||
import { RouterModule } from '@angular/router'; | ||
import { MatButtonModule } from '@angular/material/button'; | ||
import { ActivatedRoute } from '@angular/router'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@angular/router imported multiple times.
A 9. és 11. sort vond össze: import { RouterModule, ActivatedRoute } from '@angular/router';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
javítva
], | ||
}).compileComponents(); | ||
|
||
resourceService = TestBed.inject(ResourceService) as jasmine.SpyObj<ResourceService>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nem használod sehol a resourceService változót, így eltávolítható innen és a 16. sorból is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
javítva
}).compileComponents(); | ||
|
||
resourceService = TestBed.inject(ResourceService) as jasmine.SpyObj<ResourceService>; | ||
matDialog = TestBed.inject(MatDialog) as jasmine.SpyObj<MatDialog>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nem használod sehol a matDialog változót, így eltávolítható innen és a 17. sorból is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
javítva
@@ -2,15 +2,3 @@ import { TestBed } from '@angular/core/testing'; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused import TestBed, ResourceService
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
javítva
Quality Gate failedFailed conditions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kijavítottál mindent. Így már jó lesz szerintem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Szépen strukturált tesztek, jó hogy @csaba012 javasolt módosításokat, így sokkal tisztább kód.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Szép munka. Ezek a változtatások sokkal tisztább kódot eredményeztek.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A feladat megoldásával mindent rendben találtam.
Ezt a branchet merge-lem a main-be. |
Tesztek a komponensekhez a .component.spec.ts fajlokban