Skip to content

Commit

Permalink
mirage/crate-owner-invitation: Sort users by id
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 committed Aug 28, 2021
1 parent e7980cc commit cb6c0fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions mirage/serializers/crate-owner-invitation.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export default BaseSerializer.extend({
this._adjust(hash);
}

addToIncludes.sort((a, b) => a.id - b.id);

return [hash, addToIncludes];
},

Expand Down
14 changes: 7 additions & 7 deletions tests/mirage/me/crate-owner-invitations/list-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ module('Mirage | GET /api/v1/me/crate_owner_invitations', function (hooks) {
},
],
users: [
{
avatar: user.avatar,
id: Number(user.id),
login: user.login,
name: user.name,
url: user.url,
},
{
avatar: 'https://avatars1.githubusercontent.com/u/14631425?v=4',
id: Number(inviter.id),
Expand All @@ -80,13 +87,6 @@ module('Mirage | GET /api/v1/me/crate_owner_invitations', function (hooks) {
name: 'wycats',
url: 'https://github.com/wycats',
},
{
avatar: user.avatar,
id: Number(user.id),
login: user.login,
name: user.name,
url: user.url,
},
],
});
});
Expand Down

0 comments on commit cb6c0fd

Please sign in to comment.