Files
pleno-vue/tests/unit/department-daily-report-weather-wiring.spec.js
Jeppe Bundgaard 3cc0a5bb15 Add tests for DepartmentWeather and update daily report wiring:
- Added unit tests for `DepartmentWeather` component to validate weather API calls, state handling, and edge cases (e.g., no departments, stale responses, hidden hours).
- Updated `DepartmentDailyReport` wiring to pass `department_ids`, `date_from`, and `date_to` to `DepartmentWeather`.
- Enhanced OpenAPI definition for weather timeline API with refined query parameters (`date_from`, `date_to`) and updated descriptions.
- Improved `GoalFormModal` layout, adding `department-grid--single-scroll` for better scrolling behavior and responsiveness.
2026-03-24 13:33:17 +01:00

19 lines
751 B
JavaScript

import { readFileSync } from "node:fs";
import { join } from "node:path";
import { describe, expect, it } from "vitest";
const root = process.cwd();
const dailyReportSource = readFileSync(
join(root, "src/views/dashboards/departmentDashboard/modules/daily-report/DepartmentDailyReport.vue"),
"utf8"
);
describe("DepartmentDailyReport weather wiring", () => {
it("passes selected departments and selected range to DepartmentWeather", () => {
expect(dailyReportSource).toContain("<DepartmentWeather");
expect(dailyReportSource).toContain(':department_ids="selected_department_ids"');
expect(dailyReportSource).toContain(':date_from="selected_date"');
expect(dailyReportSource).toContain(':date_to="selected_date_to"');
});
});