Skip to content

Commit

Permalink
test presence of the id field in users
Browse files Browse the repository at this point in the history
  • Loading branch information
SillyFreak committed Jul 28, 2020
1 parent f4e06a8 commit b9e2b29
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/controller/user.spec.js
Expand Up @@ -31,6 +31,7 @@ describe('User Controller', () => {
});
// toMatchObject because sequelize model instances are not plain objects
expect(user).toMatchObject({
id: expect.any(Number),
uuid: expect.any(String),
createdAt: expect.any(Date),
updatedAt: expect.any(Date),
Expand All @@ -47,6 +48,7 @@ describe('User Controller', () => {
});
// toMatchObject because sequelize model instances are not plain objects
expect(user).toMatchObject({
id: expect.any(Number),
uuid: expect.any(String),
createdAt: expect.any(Date),
updatedAt: expect.any(Date),
Expand All @@ -63,13 +65,15 @@ describe('User Controller', () => {
// toMatchObject because sequelize model instances are not plain objects
expect(users).toMatchObject([
{
id: expect.any(Number),
uuid: expect.any(String),
createdAt: expect.any(Date),
updatedAt: expect.any(Date),
plugin_uuid,
native_id: 'user',
},
{
id: expect.any(Number),
uuid: expect.any(String),
createdAt: expect.any(Date),
updatedAt: expect.any(Date),
Expand All @@ -85,6 +89,7 @@ describe('User Controller', () => {
// toMatchObject because sequelize model instances are not plain objects
expect(users).toMatchObject([
{
id: expect.any(Number),
uuid: expect.any(String),
createdAt: expect.any(Date),
updatedAt: expect.any(Date),
Expand All @@ -107,6 +112,7 @@ describe('User Controller', () => {
const user = await User.read(id1);
// toMatchObject because sequelize model instances are not plain objects
expect(user).toMatchObject({
id: expect.any(Number),
uuid: expect.any(String),
createdAt: expect.any(Date),
updatedAt: expect.any(Date),
Expand All @@ -128,6 +134,7 @@ describe('User Controller', () => {
const user = await User.readByUuid(uuid2, plugin_uuid);
// toMatchObject because sequelize model instances are not plain objects
expect(user).toMatchObject({
id: expect.any(Number),
uuid: expect.any(String),
createdAt: expect.any(Date),
updatedAt: expect.any(Date),
Expand Down

0 comments on commit b9e2b29

Please sign in to comment.