File tree Expand file tree Collapse file tree
webpack/components/PreupgradeReports/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { testComponentSnapshotsWithFixtures } from '@theforeman/test' ;
1+ import React from 'react' ;
2+ import { render , screen } from '@testing-library/react' ;
3+ import '@testing-library/jest-dom' ;
24
35import NoReports from './NoReports' ;
46
5- const fixtures = {
6- 'should render when reports expected' : {
7- reportsExpected : true ,
8- } ,
9- 'should render when reports not expected' : {
10- reportsExpected : false ,
11- } ,
12- } ;
13-
14- describe ( 'NoReports' , ( ) =>
15- testComponentSnapshotsWithFixtures ( NoReports , fixtures ) ) ;
7+ describe ( 'NoReports' , ( ) => {
8+ it ( 'should render when reports expected' , ( ) => {
9+ render ( < NoReports reportsExpected /> ) ;
10+
11+ expect ( screen . getByText ( 'No Preupgrade Report Available' ) ) . toBeInTheDocument ( ) ;
12+ expect (
13+ screen . getByText (
14+ 'The preupgrade report could not be generated, check the job details for the reason'
15+ )
16+ ) . toBeInTheDocument ( ) ;
17+ } ) ;
18+
19+ it ( 'should render when reports not expected' , ( ) => {
20+ render ( < NoReports reportsExpected = { false } /> ) ;
21+
22+ expect ( screen . getByText ( 'No Preupgrade Report Available' ) ) . toBeInTheDocument ( ) ;
23+ expect (
24+ screen . getByText (
25+ 'The preupgrade report will be available after the job finishes'
26+ )
27+ ) . toBeInTheDocument ( ) ;
28+ } ) ;
29+ } ) ;
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments