Skip to content
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

Merged
merged 7 commits into from
May 21, 2024
Merged

UI tesztek #19

merged 7 commits into from
May 21, 2024

Conversation

LGietLaci37
Copy link
Contributor

Tesztek a komponensekhez a .component.spec.ts fajlokban

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
@LGietLaci37 LGietLaci37 self-assigned this May 18, 2024
@LGietLaci37 LGietLaci37 linked an issue May 18, 2024 that may be closed by this pull request
@LGietLaci37 LGietLaci37 removed the request for review from matesze41nons May 18, 2024 13:56
Copy link
Contributor

@csaba012 csaba012 left a 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';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import: throwError

Copy link
Contributor Author

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';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import: MatDialog, MatDialogRef

Copy link
Contributor Author

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';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import: PopUpWindowComponent

Copy link
Contributor Author

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']);
Copy link
Contributor

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

Copy link
Contributor Author

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';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import: HttpClient

Copy link
Contributor Author

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';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import: ReactiveFormsModule

Copy link
Contributor Author

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';
Copy link
Contributor

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';

Copy link
Contributor Author

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>;
Copy link
Contributor

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.

Copy link
Contributor Author

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>;
Copy link
Contributor

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.

Copy link
Contributor Author

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';

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused import TestBed, ResourceService

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

javítva

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@LGietLaci37 LGietLaci37 requested a review from csaba012 May 20, 2024 17:45
Copy link
Contributor

@csaba012 csaba012 left a 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.

@LGietLaci37 LGietLaci37 requested a review from matesze41nons May 20, 2024 20:09
Copy link
Contributor

@matesze41nons matesze41nons left a 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.

Copy link
Contributor

@zolykovacs zolykovacs left a 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.

Copy link
Contributor

@kolcsong kolcsong left a 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.

@kolcsong
Copy link
Contributor

Ezt a branchet merge-lem a main-be.

@kolcsong kolcsong merged commit 501d839 into main May 21, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI tesztek készítése
5 participants