Skip to content

Commit

Permalink
Add test for renderSolution fix
Browse files Browse the repository at this point in the history
  • Loading branch information
EMaksy committed Oct 9, 2023
1 parent 8fc04f4 commit aac5c6f
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions assets/js/components/SaptuneDetails/SaptuneDetails.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,36 @@ describe('SaptuneDetails', () => {
staging.solutions_ids
);
});

it('should display dashes for enabled and applied solutions when solution is null', () => {
const solution = null;

const {
configured_version: configuredVersion,
package_version: packageVersion,
services,
staging,
tuning_state: tuningState,
} = saptuneStatusFactory.build();
const { hostname, id: hostID } = hostFactory.build();
renderWithRouter(
<SaptuneDetails
appliedSolution={solution}
enabledSolution={solution}
hostname={hostname}
hostID={hostID}
configuredVersion={configuredVersion}
packageVersion={packageVersion}
services={services}
staging={staging}
tuningState={tuningState}
/>
);
expect(screen.getByText('Enabled Solution').nextSibling).toHaveTextContent(
`-`
);
expect(screen.getByText('Applied Solution').nextSibling).toHaveTextContent(
`-`
);
});
});

0 comments on commit aac5c6f

Please sign in to comment.