11import { render , screen } from '@testing-library/react' ;
2- import { DateTime } from 'luxon' ;
32import { GukCoreProvider } from '../../../../core' ;
43import { modulesCopy } from '../../../assets' ;
54import { ActionSimulation } from './actionSimulation' ;
@@ -47,11 +46,7 @@ describe('<ActionSimulation /> component', () => {
4746 it ( 'renders the execution status label' , ( ) => {
4847 render (
4948 createTestComponent ( {
50- lastSimulation : {
51- timestamp : DateTime . now ( ) . toMillis ( ) ,
52- url : 'https://dashboard.tenderly.co/simulation/12345' ,
53- status : 'success' ,
54- } ,
49+ lastSimulation : { timestamp : 0 , url : '' , status : 'success' } ,
5550 } ) ,
5651 ) ;
5752 expect ( screen . getByText ( actionSimulationCopy . likelyToSucceed ) ) . toBeInTheDocument ( ) ;
@@ -60,11 +55,7 @@ describe('<ActionSimulation /> component', () => {
6055 it ( 'renders failure status label' , ( ) => {
6156 render (
6257 createTestComponent ( {
63- lastSimulation : {
64- timestamp : DateTime . now ( ) . toMillis ( ) ,
65- url : 'https://dashboard.tenderly.co/simulation/12345' ,
66- status : 'failed' ,
67- } ,
58+ lastSimulation : { timestamp : 0 , url : '' , status : 'failed' } ,
6859 } ) ,
6960 ) ;
7061 expect ( screen . getByText ( actionSimulationCopy . likelyToFail ) ) . toBeInTheDocument ( ) ;
@@ -76,24 +67,20 @@ describe('<ActionSimulation /> component', () => {
7667 } ) ;
7768
7869 it ( 'renders loading state when execution status is loading' , ( ) => {
79- render (
80- createTestComponent ( {
81- isLoading : true ,
82- } ) ,
83- ) ;
70+ render ( createTestComponent ( { isLoading : true } ) ) ;
8471
8572 expect ( screen . getAllByText ( actionSimulationCopy . simulating ) ) . toHaveLength ( 3 ) ;
8673 } ) ;
8774
88- it ( 'shows simulate button by default when isSimulatable is not specified' , ( ) => {
75+ it ( 'shows simulate button by default when isEnabled is not specified' , ( ) => {
8976 render ( createTestComponent ( ) ) ;
9077
9178 expect ( screen . getByText ( actionSimulationCopy . simulate ) ) . toBeInTheDocument ( ) ;
9279 } ) ;
9380
94- it ( 'hides simulate button when isSimulatable is false' , ( ) => {
81+ it ( 'hides simulate button when isEnabled is false' , ( ) => {
9582 render ( createTestComponent ( { isEnabled : false } ) ) ;
9683
97- expect ( screen . queryByText ( actionSimulationCopy . simulate ) ) . toBeNull ( ) ;
84+ expect ( screen . queryByText ( actionSimulationCopy . simulate ) ) . not . toBeInTheDocument ( ) ;
9885 } ) ;
9986} ) ;
0 commit comments