Skip to content

Commit

Permalink
More tests and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
martin308 committed Dec 30, 2022
1 parent 4bc0f2e commit 29ce987
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/hub.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,16 @@ describe('hub', () => {

expect(shades).toHaveLength(1);

expect(route).toHaveBeenCalledTimes(1);
expect(route).toHaveBeenCalledWith(
expect.objectContaining({
originalUrl: '/home/shades/positions?ids=1',
method: 'PUT',
request: expect.objectContaining({
body: { positions: { primary: 1 } },
}),
}),
expect.any(Function),
);

hub.close();
});
Expand Down
2 changes: 1 addition & 1 deletion src/hub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class Hub {

const res = await fetch(url, {
method: 'PUT',
body: JSON.stringify({ positions: { primary: position } }),
body: JSON.stringify({ positions: position }),
headers: {'Content-Type': 'application/json'},
});

Expand Down

0 comments on commit 29ce987

Please sign in to comment.