Skip to content

Commit

Permalink
fix jest
Browse files Browse the repository at this point in the history
  • Loading branch information
stephmilovic committed May 4, 2020
1 parent e175cb6 commit b6a1641
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ import {
useGetCaseUserActions,
UseGetCaseUserActions,
} from './use_get_case_user_actions';
import { basicCase, basicPushSnake, caseUserActions, elasticUser, getUserAction } from './mock';
import {
basicCase,
basicPush,
basicPushSnake,
caseUserActions,
elasticUser,
getUserAction,
} from './mock';
import * as api from './api';

jest.mock('./api');
Expand Down Expand Up @@ -112,7 +119,7 @@ describe('useGetCaseUserActions', () => {
hasDataToPush: false,
caseServices: {
'123': {
...basicPushSnake,
...basicPush,
firstPushIndex: 3,
lastPushIndex: 3,
hasDataToPush: false,
Expand All @@ -132,7 +139,7 @@ describe('useGetCaseUserActions', () => {
hasDataToPush: true,
caseServices: {
'123': {
...basicPushSnake,
...basicPush,
firstPushIndex: 3,
lastPushIndex: 3,
hasDataToPush: true,
Expand All @@ -152,7 +159,7 @@ describe('useGetCaseUserActions', () => {
hasDataToPush: false,
caseServices: {
'123': {
...basicPushSnake,
...basicPush,
firstPushIndex: 3,
lastPushIndex: 3,
hasDataToPush: false,
Expand All @@ -172,7 +179,7 @@ describe('useGetCaseUserActions', () => {
hasDataToPush: false,
caseServices: {
'123': {
...basicPushSnake,
...basicPush,
firstPushIndex: 3,
lastPushIndex: 5,
hasDataToPush: false,
Expand Down Expand Up @@ -205,13 +212,16 @@ describe('useGetCaseUserActions', () => {
hasDataToPush: true,
caseServices: {
'123': {
...basicPushSnake,
...basicPush,
firstPushIndex: 3,
lastPushIndex: 3,
hasDataToPush: true,
},
'456': {
...push456,
...basicPush,
connectorId: '456',
connectorName: 'other connector name',
externalId: 'other_external_id',
firstPushIndex: 5,
lastPushIndex: 5,
hasDataToPush: false,
Expand Down Expand Up @@ -244,13 +254,16 @@ describe('useGetCaseUserActions', () => {
hasDataToPush: false,
caseServices: {
'123': {
...basicPushSnake,
...basicPush,
firstPushIndex: 3,
lastPushIndex: 3,
hasDataToPush: true,
},
'456': {
...push456,
...basicPush,
connectorId: '456',
connectorName: 'other connector name',
externalId: 'other_external_id',
firstPushIndex: 5,
lastPushIndex: 5,
hasDataToPush: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import React from 'react';
import { getUserAction } from '../../../../containers/case/mock';
import { basicPush, getUserAction } from '../../../../containers/case/mock';
import { getLabelTitle } from './helpers';
import * as i18n from '../case_view/translations';
import { mount } from 'enzyme';
Expand Down Expand Up @@ -111,7 +111,7 @@ describe('User action tree helpers', () => {
.find(`[data-test-subj="pushed-label"]`)
.first()
.text()
).toEqual(i18n.PUSHED_NEW_INCIDENT);
).toEqual(`${i18n.PUSHED_NEW_INCIDENT} ${basicPush.connectorName}`);
expect(
wrapper
.find(`[data-test-subj="pushed-value"]`)
Expand All @@ -134,7 +134,7 @@ describe('User action tree helpers', () => {
.find(`[data-test-subj="pushed-label"]`)
.first()
.text()
).toEqual(i18n.UPDATE_INCIDENT);
).toEqual(`${i18n.UPDATE_INCIDENT} ${basicPush.connectorName}`);
expect(
wrapper
.find(`[data-test-subj="pushed-value"]`)
Expand Down

0 comments on commit b6a1641

Please sign in to comment.