Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
Signed-off-by: ianmuchyri <[email protected]>
  • Loading branch information
ianmuchyri committed Nov 29, 2024
1 parent 9a546e1 commit 63fe0da
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
18 changes: 7 additions & 11 deletions examples/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ mySdk.users
mySdk.users
.Update(
{ id: "<userId>", first_name: "<firstName>", last_name: "<lastName>" },
token
token,
)
.then((response: any) => {
console.log("response: ", response);
Expand All @@ -85,7 +85,7 @@ mySdk.users
mySdk.users
.UpdateUsername(
{ id: "<userId>", credentials: { username: "<username>" } },
token
token,
)
.then((response: any) => {
console.log("response: ", response);
Expand All @@ -97,7 +97,7 @@ mySdk.users
mySdk.users
.UpdateProfilePicture(
{ id: "<userId>", profile_picture: "<profilePicture>" },
token
token,
)
.then((response: any) => {
console.log("response: ", response);
Expand Down Expand Up @@ -125,7 +125,7 @@ mySdk.users
});

mySdk.users
.Disable({ id: "<userId>" }, token)
.Disable("<userId>", token)
.then((response: any) => {
console.log("response: ", response);
})
Expand All @@ -134,7 +134,7 @@ mySdk.users
});

mySdk.users
.Enable({ id: "<userId>" }, token)
.Enable("<userId>", token)
.then((response: any) => {
console.log("response: ", response);
})
Expand Down Expand Up @@ -169,12 +169,8 @@ mySdk.users
console.error(error);
});

mySdk.users.ListUserClients(
"<domainId>",
"<userId>",
{ offset: 0, limit: 10 },
token,
)
mySdk.users
.ListUserClients("<domainId>", "<userId>", { offset: 0, limit: 10 }, token)
.then((response: any) => {
console.log("response: ", response);
})
Expand Down
4 changes: 2 additions & 2 deletions tests/users.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,14 +215,14 @@ describe("Users", () => {
test("Disable user should disable a user", async () => {
fetchMock.mockResponseOnce(JSON.stringify(user));

const response = await sdk.users.Disable(user, token);
const response = await sdk.users.Disable(user.id as string, token);
expect(response).toEqual(user);
});

test("Enable user should enable a user", async () => {
fetchMock.mockResponseOnce(JSON.stringify(user));

const response = await sdk.users.Enable(user, token);
const response = await sdk.users.Enable(user.id as string, token);
expect(response).toEqual(user);
});

Expand Down

0 comments on commit 63fe0da

Please sign in to comment.