Files
StarPilot/openpilot/starpilot/galaxy/tests/test_device_preferences.mjs
T
firestar5683 80fbb4f6db Feature registration
Register vehicle controls, planner modes, UI actions and Galaxy services after their providers exist. Wire the shared runtime entrypoints and cover their combined behavior.

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Daniel Koepping <elkoled@gmail.com>
Co-authored-by: Danny <dannyirwin31@yahoo.com>
Co-authored-by: DimitriChrysafis <Dimitri.chrysafis@gmail.com>
Co-authored-by: Dom <168790843+firestar5683@users.noreply.github.com>
Co-authored-by: Harald Schäfer <harald.the.engineer@gmail.com>
Co-authored-by: Kacper Rączy <gfw.kra@gmail.com>
Co-authored-by: Prabhaav Pillai <prabhaav@msu.edu>
Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com>
Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com>
Co-authored-by: stef <19478336+stefpi@users.noreply.github.com>
Co-authored-by: whoisdomi <dcantu83@gmail.com>

Co-authored-by: Intelli <contact@intelli.software>
Co-authored-by: haraschax <6804392+haraschax@users.noreply.github.com>
Co-authored-by: prabhaavp <prabhaav@msu.edu>
2026-10-14 20:02:39 -05:00

13 lines
947 B
JavaScript

import assert from "node:assert/strict"
import { readFileSync } from "node:fs"
import { DEVICE_PAGES, DevicePreferencesPage, devicePage } from "../web/js/device-preferences.js"
import { DriveStatePanel } from "../web/js/drive-state.js"
assert.deepEqual(Object.keys(DEVICE_PAGES), [])
for (const path of ["/device-preferences", "/device-preferences/sounds", "/device-preferences/display", "/device-preferences/alpha"]) assert.equal(devicePage(path), null)
assert.equal(DevicePreferencesPage.components.DriveStatePanel, DriveStatePanel)
assert.match(DevicePreferencesPage.template, /<DriveStatePanel v-if="mode === 'local'"/)
assert.match(DevicePreferencesPage.template, /Force Drive State/)
assert.doesNotMatch(DevicePreferencesPage.template, /sounds|display|SettingsPage/)
const app = readFileSync(new URL("../web/js/app.js", import.meta.url), "utf8")
assert.match(app, /<DevicePreferencesPage v-else-if="route\.path === '\/device-preferences'"/)