Add version to index page

This commit is contained in:
simojenki
2021-08-31 09:12:53 +10:00
parent c73f79532d
commit 00f6a9ff8f
6 changed files with 39 additions and 2 deletions

View File

@@ -179,6 +179,27 @@ describe("server", () => {
[bonobUrlWithNoContextPath, bonobUrlWithContextPath].forEach((bonobUrl) => {
describe(`a bonobUrl of ${bonobUrl}`, () => {
describe("/", () => {
describe("displaying of version", () => {
const server = makeServer(
SONOS_DISABLED,
aService(),
bonobUrl,
new InMemoryMusicService(),
{
version: "v123.456"
}
);
it("should display it", async () => {
const res = await request(server)
.get(bonobUrl.append({ pathname: "/" }).pathname())
.send();
expect(res.status).toEqual(200);
expect(res.text).toMatch(/v123\.456/);
});
});
describe("when sonos integration is disabled", () => {
const server = makeServer(
SONOS_DISABLED,