refactor: Use toStrictEqual instead of toEqual for tests
This commit is contained in:
@@ -16,6 +16,6 @@ describe('actionSerializer', () => {
|
||||
type: action.type,
|
||||
};
|
||||
|
||||
expect(actionSerializer(action)).toEqual(expectedPayload);
|
||||
expect(expectedPayload).toMatchObject(actionSerializer(action));
|
||||
});
|
||||
});
|
||||
|
@@ -25,7 +25,7 @@ describe('adminSamlAuthProviderSerializer', () => {
|
||||
defaultRoleId: samlAuthProvider.defaultRoleId,
|
||||
};
|
||||
|
||||
expect(adminSamlAuthProviderSerializer(samlAuthProvider)).toEqual(
|
||||
expect(adminSamlAuthProviderSerializer(samlAuthProvider)).toStrictEqual(
|
||||
expectedPayload
|
||||
);
|
||||
});
|
||||
|
@@ -12,7 +12,7 @@ describe('adminUserSerializer', () => {
|
||||
it('should return user data with accept invitation url', async () => {
|
||||
const serializedUser = adminUserSerializer(user);
|
||||
|
||||
expect(serializedUser.acceptInvitationUrl).toEqual(
|
||||
expect(serializedUser.acceptInvitationUrl).toStrictEqual(
|
||||
user.acceptInvitationUrl
|
||||
);
|
||||
});
|
||||
|
@@ -17,6 +17,8 @@ describe('appAuthClient serializer', () => {
|
||||
active: appAuthClient.active,
|
||||
};
|
||||
|
||||
expect(appAuthClientSerializer(appAuthClient)).toEqual(expectedPayload);
|
||||
expect(appAuthClientSerializer(appAuthClient)).toStrictEqual(
|
||||
expectedPayload
|
||||
);
|
||||
});
|
||||
});
|
||||
|
@@ -15,6 +15,6 @@ describe('appSerializer', () => {
|
||||
primaryColor: app.primaryColor,
|
||||
};
|
||||
|
||||
expect(appSerializer(app)).toEqual(expectedPayload);
|
||||
expect(appSerializer(app)).toStrictEqual(expectedPayload);
|
||||
});
|
||||
});
|
||||
|
@@ -12,6 +12,6 @@ describe('authSerializer', () => {
|
||||
reconnectionSteps: auth.reconnectionSteps,
|
||||
};
|
||||
|
||||
expect(authSerializer(auth)).toEqual(expectedPayload);
|
||||
expect(authSerializer(auth)).toStrictEqual(expectedPayload);
|
||||
});
|
||||
});
|
||||
|
@@ -27,6 +27,6 @@ describe('configSerializer', () => {
|
||||
updatedAt: config.updatedAt.getTime(),
|
||||
};
|
||||
|
||||
expect(configSerializer(config)).toEqual(expectedPayload);
|
||||
expect(configSerializer(config)).toStrictEqual(expectedPayload);
|
||||
});
|
||||
});
|
||||
|
@@ -23,6 +23,6 @@ describe('connectionSerializer', () => {
|
||||
updatedAt: connection.updatedAt.getTime(),
|
||||
};
|
||||
|
||||
expect(connectionSerializer(connection)).toEqual(expectedPayload);
|
||||
expect(connectionSerializer(connection)).toStrictEqual(expectedPayload);
|
||||
});
|
||||
});
|
||||
|
@@ -26,7 +26,9 @@ describe('executionStepSerializer', () => {
|
||||
updatedAt: executionStep.updatedAt.getTime(),
|
||||
};
|
||||
|
||||
expect(executionStepSerializer(executionStep)).toEqual(expectedPayload);
|
||||
expect(executionStepSerializer(executionStep)).toStrictEqual(
|
||||
expectedPayload
|
||||
);
|
||||
});
|
||||
|
||||
it('should return the execution step data with the step', async () => {
|
||||
|
@@ -23,7 +23,7 @@ describe('executionSerializer', () => {
|
||||
updatedAt: execution.updatedAt.getTime(),
|
||||
};
|
||||
|
||||
expect(executionSerializer(execution)).toEqual(expectedPayload);
|
||||
expect(executionSerializer(execution)).toStrictEqual(expectedPayload);
|
||||
});
|
||||
|
||||
it('should return the execution data with status', async () => {
|
||||
@@ -37,7 +37,7 @@ describe('executionSerializer', () => {
|
||||
status: 'success',
|
||||
};
|
||||
|
||||
expect(executionSerializer(execution)).toEqual(expectedPayload);
|
||||
expect(executionSerializer(execution)).toStrictEqual(expectedPayload);
|
||||
});
|
||||
|
||||
it('should return the execution data with the flow', async () => {
|
||||
|
@@ -31,7 +31,7 @@ describe('flowSerializer', () => {
|
||||
updatedAt: flow.updatedAt.getTime(),
|
||||
};
|
||||
|
||||
expect(flowSerializer(flow)).toEqual(expectedPayload);
|
||||
expect(flowSerializer(flow)).toStrictEqual(expectedPayload);
|
||||
});
|
||||
|
||||
it('should return flow data with the steps', async () => {
|
||||
|
@@ -20,6 +20,6 @@ describe('permissionSerializer', () => {
|
||||
updatedAt: permission.updatedAt.getTime(),
|
||||
};
|
||||
|
||||
expect(permissionSerializer(permission)).toEqual(expectedPayload);
|
||||
expect(permissionSerializer(permission)).toStrictEqual(expectedPayload);
|
||||
});
|
||||
});
|
||||
|
@@ -34,7 +34,7 @@ describe('roleSerializer', () => {
|
||||
isAdmin: role.isAdmin,
|
||||
};
|
||||
|
||||
expect(roleSerializer(role)).toEqual(expectedPayload);
|
||||
expect(roleSerializer(role)).toStrictEqual(expectedPayload);
|
||||
});
|
||||
|
||||
it('should return role data with the permissions', async () => {
|
||||
|
@@ -17,7 +17,7 @@ describe('samlAuthProviderSerializer', () => {
|
||||
issuer: samlAuthProvider.issuer,
|
||||
};
|
||||
|
||||
expect(samlAuthProviderSerializer(samlAuthProvider)).toEqual(
|
||||
expect(samlAuthProviderSerializer(samlAuthProvider)).toStrictEqual(
|
||||
expectedPayload
|
||||
);
|
||||
});
|
||||
|
@@ -24,7 +24,7 @@ describe('stepSerializer', () => {
|
||||
parameters: step.parameters,
|
||||
};
|
||||
|
||||
expect(stepSerializer(step)).toEqual(expectedPayload);
|
||||
expect(stepSerializer(step)).toStrictEqual(expectedPayload);
|
||||
});
|
||||
|
||||
it('should return step data with the last execution step', async () => {
|
||||
|
@@ -30,6 +30,6 @@ describe('subscriptionSerializer', () => {
|
||||
cancellationEffectiveDate: subscription.cancellationEffectiveDate,
|
||||
};
|
||||
|
||||
expect(subscriptionSerializer(subscription)).toEqual(expectedPayload);
|
||||
expect(subscriptionSerializer(subscription)).toStrictEqual(expectedPayload);
|
||||
});
|
||||
});
|
||||
|
@@ -16,6 +16,6 @@ describe('triggerSerializer', () => {
|
||||
type: trigger.type,
|
||||
};
|
||||
|
||||
expect(triggerSerializer(trigger)).toEqual(expectedPayload);
|
||||
expect(triggerSerializer(trigger)).toStrictEqual(expectedPayload);
|
||||
});
|
||||
});
|
||||
|
@@ -39,7 +39,7 @@ describe('userSerializer', () => {
|
||||
updatedAt: user.updatedAt.getTime(),
|
||||
};
|
||||
|
||||
expect(userSerializer(user)).toEqual(expectedPayload);
|
||||
expect(userSerializer(user)).toStrictEqual(expectedPayload);
|
||||
});
|
||||
|
||||
it('should return user data with the role', async () => {
|
||||
|
Reference in New Issue
Block a user