1
0
This repository has been archived on 2026-06-27. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
MSE-PI-E2EEDA-Plein-de-eeee…/ui/src/app/app.component.spec.ts
khalil-bot 27a38366c3 feat(ui): implement interactive room map with REST services and unit tests
- Add SensorReading model with CO2, temperature, humidity, window state, timestamp
- Add RoomService and SensorService with HTTP calls and mock data fallback
- Rewrite RoomMapComponent: SVG floor plan, CO2-based coloring, tooltips, navigation
- Rewrite RoomDetailsPanelComponent: sensor history table with pagination (8 rows/page)
- Add FooterComponent with current year, fix header/footer sticky layout
- Update LegendComponent template and styles for two-line item layout
- Add provideHttpClient() to app.config.ts
- Add getCO2Color() and getCO2Level() helpers to co2-levels.config.ts
- Add 85 unit tests across all components, services, and config helpers

Closes #28
Closes #29
2026-05-27 22:00:11 +02:00

40 lines
1.3 KiB
TypeScript

import { TestBed } from '@angular/core/testing';
import { AppComponent } from './app.component';
import { provideRouter } from '@angular/router';
import { routes } from './app.routes';
describe('AppComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [AppComponent],
providers: [provideRouter(routes)],
}).compileComponents();
});
it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});
it(`should have the 'PI_E2EEDA Dashboard' title`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('PI_E2EEDA Dashboard');
});
it('should render header', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('app-header')).toBeTruthy();
});
it('should render footer', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('app-footer')).toBeTruthy();
});
});