- 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
40 lines
1.3 KiB
TypeScript
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();
|
|
});
|
|
});
|