Skip to content

Commit

Permalink
tests(client): use location fixtures in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlatz committed May 5, 2024
1 parent 490b8ea commit 5efd110
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
23 changes: 1 addition & 22 deletions client/mirage/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,28 +65,7 @@ function routes() {

this.patch('/api/ships/:id');

this.get('/api/locations', () => {
return {
data: [
{
id: 'earth',
type: 'location',
attributes: {
name: 'Earth',
position: { x: 1, y: 2 },
},
},
{
id: 'moon',
type: 'location',
attributes: {
name: 'Moon',
position: { x: 1, y: 2 },
},
},
],
};
});
this.get('/api/locations');

// These comments are here to help you get started. Feel free to delete them.

Expand Down
12 changes: 12 additions & 0 deletions client/mirage/fixtures/locations.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export default [
{
id: 'earth',
name: 'Earth',
position: { x: 1, y: 2 },
},
{
id: 'moon',
name: 'Moon',
position: { x: 1, y: 2 },
},
];

0 comments on commit 5efd110

Please sign in to comment.