Skip to content

Commit

Permalink
fix tests and ci
Browse files Browse the repository at this point in the history
  • Loading branch information
luifr10 committed Dec 3, 2023
1 parent edc2aa5 commit 7931652
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 13 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
cache: 'npm'
- run: npm ci
- run: npm test
- run: npm start &
- run: npx uuv e2e --generateHtmlReport
- run: npm run build --if-present -- --base-href=/weather-app/
- name: Upload build artifact
Expand All @@ -34,7 +33,7 @@ jobs:

publish:
if: github.ref == 'refs/heads/main'
needs: [ build ]
needs: [ build-and-test ]
permissions:
pages: write
id-token: write
Expand Down
7 changes: 0 additions & 7 deletions src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,4 @@ describe('AppComponent', () => {
const app = fixture.componentInstance;
expect(app.title).toEqual('weather-app');
});

it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('.app-name')?.textContent).toContain('Weather App');
});
});
10 changes: 9 additions & 1 deletion src/app/components/add-new-town/add-new-town.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { AddNewTownComponent } from './add-new-town.component';
import {HttpClientTestingModule} from "@angular/common/http/testing";
import {FormsModule, ReactiveFormsModule} from "@angular/forms";
import {RouterTestingModule} from "@angular/router/testing";

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

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ AddNewTownComponent ]
declarations: [ AddNewTownComponent ],
imports: [
HttpClientTestingModule,
RouterTestingModule,
ReactiveFormsModule
]
})
.compileComponents();

Expand Down
4 changes: 3 additions & 1 deletion src/app/components/weather/weather.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { TownSelectorComponent } from '@components/town-selector/town-selector.c
import { HttpClientModule } from '@angular/common/http';
import {NgxsModule} from "@ngxs/store";
import {GeneralState} from "@stores/general/general.state";
import {RouterTestingModule} from "@angular/router/testing";

describe('WeatherComponent', () => {
let component: WeatherComponent;
Expand All @@ -25,7 +26,8 @@ describe('WeatherComponent', () => {
HttpClientModule,
NgxsModule.forRoot([
GeneralState
])
]),
RouterTestingModule
]
})
.compileComponents();
Expand Down
11 changes: 9 additions & 2 deletions uuv/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,18 @@ export default defineConfig({
workers: 1,
reporter: "@uuv/playwright/uuv-playwright-reporter",
use: {
baseURL: "http://localhost:4200",
baseURL: "http://127.0.0.1:4200",
trace: "on-first-retry",
screenshot: "only-on-failure"
},

webServer: [
{
command: 'npm run start',
url: 'http://127.0.0.1:4200',
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI
}
],
projects: [
{
name: "chromium",
Expand Down

0 comments on commit 7931652

Please sign in to comment.