Improve error handling when Navidrome fails

This commit is contained in:
simojenki
2021-08-22 13:12:59 +10:00
parent 06db0c2088
commit 8dc98ee1a5
4 changed files with 7 additions and 8 deletions

View File

@@ -447,7 +447,7 @@ describe("Navidrome", () => {
});
const token = await navidrome.generateToken({ username, password });
expect(token).toEqual({ message: "Wrong username or password" });
expect(token).toEqual({ message: "Navidrome error:Wrong username or password" });
});
});
});
@@ -3387,7 +3387,7 @@ describe("Navidrome", () => {
.then((it) => it as AuthSuccess)
.then((it) => navidrome.login(it.authToken))
.then((it) => it.playlist(id))
).rejects.toEqual("data not found");
).rejects.toEqual("Navidrome error:data not found");
});
});
@@ -3742,7 +3742,7 @@ describe("Navidrome", () => {
});
});
describe("when there id doesnt exist", () => {
describe("when the id doesnt exist", () => {
it("should fail", async () => {
const id = "idThatHasAnError";
@@ -3756,7 +3756,7 @@ describe("Navidrome", () => {
.generateToken({ username, password })
.then((it) => it as AuthSuccess)
.then((it) => navidrome.login(it.authToken))
.then((it) => it.similarSongs(id))).rejects.toEqual("data not found");
.then((it) => it.similarSongs(id))).rejects.toEqual("Navidrome error:data not found");
});
});
});