mirror of
https://github.com/wkulhanek/bonob.git
synced 2025-12-21 17:33:29 +01:00
Use axios params on GET rather than string concat
This commit is contained in:
@@ -22,7 +22,7 @@ describe("InMemoryMusicService", () => {
|
||||
expect(musicLibrary).toBeDefined();
|
||||
});
|
||||
|
||||
it.only("should fail with an exception if an invalid token is used", async () => {
|
||||
it("should fail with an exception if an invalid token is used", async () => {
|
||||
const credentials = { username: "bob", password: "smith" };
|
||||
|
||||
service.hasUser(credentials);
|
||||
|
||||
@@ -51,10 +51,16 @@ describe("navidrome", () => {
|
||||
expect(token.userId).toEqual(username);
|
||||
|
||||
expect(axios.get).toHaveBeenCalledWith(
|
||||
`${url}/rest/ping.view?u=${username}&t=${t(
|
||||
password,
|
||||
salt
|
||||
)}&s=${salt}&v=1.16.1.0&c=bonob`
|
||||
`${url}/rest/ping.view`,
|
||||
{
|
||||
params: {
|
||||
u: username,
|
||||
t: t(password, salt),
|
||||
s: salt,
|
||||
v: "1.16.1",
|
||||
c: "bonob",
|
||||
},
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -68,7 +74,9 @@ describe("navidrome", () => {
|
||||
</subsonic-response>`,
|
||||
});
|
||||
|
||||
return expect(navidrome.generateToken({ username, password })).rejects.toMatch("Wrong username or password");
|
||||
return expect(
|
||||
navidrome.generateToken({ username, password })
|
||||
).rejects.toMatch("Wrong username or password");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user