diff --git a/web/src/views/DashboardView.test.ts b/web/src/views/DashboardView.test.ts new file mode 100644 index 0000000..ac425c2 --- /dev/null +++ b/web/src/views/DashboardView.test.ts @@ -0,0 +1,119 @@ +import { mount, flushPromises } from '@vue/test-utils' +import { createRouter, createWebHashHistory } from 'vue-router' +import { describe, it, expect, vi, beforeEach } from 'vitest' +import DashboardView from './DashboardView.vue' + +const router = createRouter({ + history: createWebHashHistory(), + routes: [ + { path: '/', component: { template: '
' } }, + { path: '/eval/benchmark', component: { template: '' } }, + { path: '/train/jobs', component: { template: '' } }, + { path: '/fleet', component: { template: '' } }, + ], +}) + +const baseDashboard = { + labeled_since_last_eval: 0, + last_eval_timestamp: null, + last_eval_best_score: null, + active_jobs: [], + corrections_export_ready: 0, + signals: { data_to_eval: false, eval_to_train: false, train_to_fleet: false }, +} + +function mockFetch(overrides: PartialComing soon.
++ {{ data.labeled_since_last_eval.toLocaleString() }} + labeled since last eval +
++ Last run: + {{ formattedEvalTime }} +
++ Best score: + {{ formatScore(data.last_eval_best_score) }} +
+No active jobs
+ ++ {{ data.corrections_export_ready }} + corrections ready +
+