Skip to content

Commit

Permalink
Merge branch 'integrationTesting' into B-21328-INT
Browse files Browse the repository at this point in the history
  • Loading branch information
antgmann authored Oct 9, 2024
2 parents adae47f + 7b81251 commit 8cf5220
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ import 'styles/office.scss';
import TabNav from 'components/TabNav';
import { isBooleanFlagEnabled } from 'utils/featureFlags';

const ServicesCounselingTabNav = ({ shipmentWarnConcernCount = 0, missingOrdersInfoCount, moveCode }) => {
const ServicesCounselingTabNav = ({
shipmentWarnConcernCount = 0,
shipmentErrorConcernCount,
missingOrdersInfoCount,
moveCode,
}) => {
const [supportingDocsFF, setSupportingDocsFF] = React.useState(false);
React.useEffect(() => {
const fetchData = async () => {
Expand All @@ -23,6 +28,9 @@ const ServicesCounselingTabNav = ({ shipmentWarnConcernCount = 0, missingOrdersI
if (shipmentWarnConcernCount > 0) {
moveDetailsTagCount += shipmentWarnConcernCount;
}
if (shipmentErrorConcernCount > 0) {
moveDetailsTagCount += shipmentErrorConcernCount;
}
if (missingOrdersInfoCount > 0) {
moveDetailsTagCount += missingOrdersInfoCount;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,19 @@ describe('Move details tag rendering', () => {
const moveDetailsTab = screen.getByTestId('MoveDetails-Tab');
expect(within(moveDetailsTab).getByTestId('tag')).toHaveTextContent('4');
});

it('should render the move details tab container with a tag that shows the count of an warn and error count', () => {
const moveDetailsShipmentAndAmendedOrders = {
...basicNavProps,
missingOrdersInfoCount: 4,
shipmentWarnConcernCount: 2,
shipmentErrorConcernCount: 1,
};
render(<ServicesCounselingTabNav {...moveDetailsShipmentAndAmendedOrders} />, { wrapper: MemoryRouter });

const moveDetailsTab = screen.getByTestId('MoveDetails-Tab');
expect(within(moveDetailsTab).getByTestId('tag')).toHaveTextContent('7');
});
});

describe('MTO tag rendering', () => {
Expand Down

0 comments on commit 8cf5220

Please sign in to comment.