Skip to content

Commit

Permalink
Merge pull request #13831 from transcom/B-21328-INT
Browse files Browse the repository at this point in the history
B 21328 int
  • Loading branch information
antgmann authored Oct 9, 2024
2 parents 7b81251 + 8cf5220 commit ce8f37e
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions playwright/tests/office/txo/tioFlows.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ test.describe('TIO user', () => {
await expect(page.getByTestId('serviceItemAmount')).toContainText('$324.00');

// Review Weights
await page.locator(weightSection).getByText('Review weights').click();
await page.locator(weightSection).getByText('Review shipment weights').click();
await officePage.waitForLoading();
await expect(page.getByText('Edit max billable weight')).toBeVisible();
await page.locator('[data-testid="closeSidebar"]').click();
Expand Down Expand Up @@ -739,7 +739,7 @@ test.describe('TIO user', () => {
await expect(page.locator(prSection)).not.toContainText('Rejected');

// Review Weights
const reviewWeightsBtn = page.locator('#billable-weights').getByText('Review weights');
const reviewWeightsBtn = page.locator('#billable-weights').getByText('Review shipment weights');
await tioFlowPage.waitForLoading();
await reviewWeightsBtn.click();

Expand Down Expand Up @@ -790,7 +790,7 @@ test.describe('TIO user', () => {
await expect(page.getByTestId('MovePaymentRequests')).toBeVisible();

// Review Weights
await page.locator('#billable-weights').getByText('Review weights').click();
await page.locator('#billable-weights').getByText('Review shipment weights').click();
await tioFlowPage.waitForLoading();
await page.locator('[data-testid="closeSidebar"]').click();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test.describe('TIO user', () => {
await expect(page.getByTestId('MovePaymentRequests')).toBeVisible();

// Review Weights
const reviewWeightsBtn = page.locator('#billable-weights').getByText('Review weights');
const reviewWeightsBtn = page.locator('#billable-weights').getByText('Review shipment weights');
await reviewWeightsBtn.click();

await page.getByRole('heading', { name: 'Review weights' }).waitFor({ state: 'visible' });
Expand Down
2 changes: 1 addition & 1 deletion playwright/tests/office/txo/tooFlows.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ test.describe('TOO user', () => {
.press('Enter');
await page.getByTestId('locator-0').click();
await page.getByRole('link', { name: 'Payment requests' }).click();
await page.getByRole('button', { name: 'Review weights' }).click();
await page.getByRole('button', { name: 'Review shipment weights' }).click();
await page.getByRole('button', { name: 'Review shipment weights' }).click();
await page.getByRole('button', { name: 'Back' }).click();
await page.getByRole('link', { name: 'Payment requests' }).click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ export default function BillableWeightCard({
<Button
onClick={onReviewWeights}
secondary={secondaryReviewWeightsBtn}
style={{ maxWidth: '160px' }}
style={{ maxWidth: '240px' }}
disabled={!shipments.length > 0 || isMoveLocked}
>
Review weights
Review shipment weights
</Button>
</Restricted>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe('BillableWeightCard', () => {
expect(screen.getByText(formatWeight(shipments[2].calculatedBillableWeight))).toBeInTheDocument();
});

it('implements the review weights handler when the review weights button is clicked', async () => {
it('implements the review weights handler when the review shipment weights button is clicked', async () => {
const shipments = [
{
id: '0001',
Expand All @@ -87,7 +87,7 @@ describe('BillableWeightCard', () => {
];
renderWithPermission({ shipments });

const reviewWeights = screen.getByRole('button', { name: 'Review weights' });
const reviewWeights = screen.getByRole('button', { name: 'Review shipment weights' });

await userEvent.click(reviewWeights);

Expand All @@ -96,17 +96,17 @@ describe('BillableWeightCard', () => {
});
});

it('should disable review weights button if no shipments are present', async () => {
it('should disable review shipment weights button if no shipments are present', async () => {
const shipments = [];
renderWithPermission({ shipments });

const reviewWeights = screen.getByRole('button', { name: 'Review weights' });
const reviewWeights = screen.getByRole('button', { name: 'Review shipment weights' });

expect(reviewWeights).toHaveAttribute('disabled');
expect(reviewWeights).toBeDisabled();
});

it('should disable review weights button if the move is locked', async () => {
it('should disable review shipment weights button if the move is locked', async () => {
const shipments = [
{
id: '0001',
Expand All @@ -120,7 +120,7 @@ describe('BillableWeightCard', () => {
const isMoveLocked = true;
renderWithPermission({ shipments, isMoveLocked });

const reviewWeights = screen.getByRole('button', { name: 'Review weights' });
const reviewWeights = screen.getByRole('button', { name: 'Review shipment weights' });

expect(reviewWeights).toHaveAttribute('disabled');
expect(reviewWeights).toBeDisabled();
Expand All @@ -139,7 +139,7 @@ describe('BillableWeightCard', () => {
];
renderWithPermission({ shipments, secondaryReviewWeightsBtn: true });

const reviewWeights = screen.getByRole('button', { name: 'Review weights' });
const reviewWeights = screen.getByRole('button', { name: 'Review shipment weights' });
expect(reviewWeights).toHaveClass('usa-button--secondary');
});

Expand All @@ -155,7 +155,7 @@ describe('BillableWeightCard', () => {
];
renderWithPermission({ shipments });

const reviewWeights = screen.getByRole('button', { name: 'Review weights' });
const reviewWeights = screen.getByRole('button', { name: 'Review shipment weights' });
expect(reviewWeights).not.toHaveClass('usa-button--secondary');
});

Expand All @@ -175,7 +175,7 @@ describe('BillableWeightCard', () => {
</MockProviders>,
);

const reviewWeights = screen.getByRole('button', { name: 'Review weights' });
const reviewWeights = screen.getByRole('button', { name: 'Review shipment weights' });
expect(reviewWeights).not.toHaveClass('usa-button--secondary');
});

Expand All @@ -191,7 +191,7 @@ describe('BillableWeightCard', () => {
];
renderWithPermission({ shipments });

const reviewWeights = screen.getByRole('button', { name: 'Review weights' });
const reviewWeights = screen.getByRole('button', { name: 'Review shipment weights' });
expect(reviewWeights).not.toHaveClass('usa-button--secondary');
});

Expand All @@ -216,7 +216,7 @@ describe('BillableWeightCard', () => {
];
renderWithPermission({ ...props, shipments });

const reviewWeights = screen.getByRole('button', { name: 'Review weights' });
const reviewWeights = screen.getByRole('button', { name: 'Review shipment weights' });
expect(reviewWeights).not.toHaveClass('usa-button--secondary');
});

Expand Down Expand Up @@ -286,7 +286,7 @@ describe('BillableWeightCard', () => {
expect(screen.getByText('4,500 lbs')).toBeInTheDocument();
});

it('does not show the review weights button with no permission', () => {
it('does not show the review shipment weights button with no permission', () => {
const shipments = [
{
id: '0001',
Expand All @@ -299,7 +299,7 @@ describe('BillableWeightCard', () => {
];
render(<BillableWeightCard {...defaultProps} shipments={shipments} />);

const reviewWeights = screen.queryByRole('button', { name: 'Review weights' });
const reviewWeights = screen.queryByRole('button', { name: 'Review shipment weights' });
expect(reviewWeights).not.toBeInTheDocument();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ describe('MovePaymentRequests', () => {
jest.spyOn(console, 'error').mockImplementation(() => {});
renderMovePaymentRequests(testProps);

const reviewWeights = screen.getByRole('button', { name: 'Review weights' });
const reviewWeights = screen.getByRole('button', { name: 'Review shipment weights' });

await userEvent.click(reviewWeights);

Expand Down Expand Up @@ -659,28 +659,28 @@ describe('MovePaymentRequests', () => {
});
});

describe('a move that does not have a billableWeightsReviewedAt timestamp displays a primary styled Review Weights btn', () => {
describe('a move that does not have a billableWeightsReviewedAt timestamp displays a primary styled Review shipment weights btn', () => {
beforeEach(() => {
useMovePaymentRequestsQueries.mockReturnValue(moveShipmentMissingReweighWeight);
});

it('shows the max billable weight warning tag in sidebar', async () => {
renderMovePaymentRequests(testProps);

const reviewWeights = screen.getByRole('button', { name: 'Review weights' });
const reviewWeights = screen.getByRole('button', { name: 'Review shipment weights' });
expect(reviewWeights).not.toHaveClass('usa-button--secondary');
});
});

describe('a move that has a billableWeightsReviewedAt timestamp displays a secondary styled Review Weights btn', () => {
describe('a move that has a billableWeightsReviewedAt timestamp displays a secondary styled Review shipment weights btn', () => {
beforeEach(() => {
useMovePaymentRequestsQueries.mockReturnValue(returnWithBillableWeightsReviewed);
});

it('shows the max billable weight warning tag in sidebar', async () => {
renderMovePaymentRequests(testProps);

const reviewWeights = screen.getByRole('button', { name: 'Review weights' });
const reviewWeights = screen.getByRole('button', { name: 'Review shipment weights' });
expect(reviewWeights).toHaveClass('usa-button--secondary');
});
});
Expand Down

0 comments on commit ce8f37e

Please sign in to comment.