From 45fdc0347d9908fc2dd0f0de4224d323419387fb Mon Sep 17 00:00:00 2001 From: antgmann Date: Thu, 3 Oct 2024 17:08:41 +0000 Subject: [PATCH 1/4] Rename button for feature AC --- .../BillableWeightCard/BillableWeightCard.jsx | 4 +-- .../BillableWeightCard.test.jsx | 26 +++++++++---------- .../MovePaymentRequests.test.jsx | 10 +++---- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/components/Office/BillableWeight/BillableWeightCard/BillableWeightCard.jsx b/src/components/Office/BillableWeight/BillableWeightCard/BillableWeightCard.jsx index 69e6fc4b03a..b037fe5aded 100644 --- a/src/components/Office/BillableWeight/BillableWeightCard/BillableWeightCard.jsx +++ b/src/components/Office/BillableWeight/BillableWeightCard/BillableWeightCard.jsx @@ -50,10 +50,10 @@ export default function BillableWeightCard({ diff --git a/src/components/Office/BillableWeight/BillableWeightCard/BillableWeightCard.test.jsx b/src/components/Office/BillableWeight/BillableWeightCard/BillableWeightCard.test.jsx index 5f02273563a..8cd2618257b 100644 --- a/src/components/Office/BillableWeight/BillableWeightCard/BillableWeightCard.test.jsx +++ b/src/components/Office/BillableWeight/BillableWeightCard/BillableWeightCard.test.jsx @@ -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', @@ -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); @@ -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', @@ -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(); @@ -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'); }); @@ -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'); }); @@ -175,7 +175,7 @@ describe('BillableWeightCard', () => { , ); - const reviewWeights = screen.getByRole('button', { name: 'Review weights' }); + const reviewWeights = screen.getByRole('button', { name: 'Review shipment weights' }); expect(reviewWeights).not.toHaveClass('usa-button--secondary'); }); @@ -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'); }); @@ -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'); }); @@ -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', @@ -299,7 +299,7 @@ describe('BillableWeightCard', () => { ]; render(); - const reviewWeights = screen.queryByRole('button', { name: 'Review weights' }); + const reviewWeights = screen.queryByRole('button', { name: 'Review shipment weights' }); expect(reviewWeights).not.toBeInTheDocument(); }); diff --git a/src/pages/Office/MovePaymentRequests/MovePaymentRequests.test.jsx b/src/pages/Office/MovePaymentRequests/MovePaymentRequests.test.jsx index d3395b7649b..a88e80f0fe5 100644 --- a/src/pages/Office/MovePaymentRequests/MovePaymentRequests.test.jsx +++ b/src/pages/Office/MovePaymentRequests/MovePaymentRequests.test.jsx @@ -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); @@ -659,7 +659,7 @@ 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); }); @@ -667,12 +667,12 @@ describe('MovePaymentRequests', () => { 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); }); @@ -680,7 +680,7 @@ describe('MovePaymentRequests', () => { 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'); }); }); From f0af3d53a894aec8fed14202a571956f9f859a54 Mon Sep 17 00:00:00 2001 From: antgmann Date: Thu, 3 Oct 2024 17:46:46 +0000 Subject: [PATCH 2/4] Resolve playwright tests --- playwright/tests/office/txo/tioFlows.spec.js | 6 +++--- .../tests/office/txo/tioUpdateMaxBillableWeight.spec.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/playwright/tests/office/txo/tioFlows.spec.js b/playwright/tests/office/txo/tioFlows.spec.js index dae55bada81..a21466a0858 100644 --- a/playwright/tests/office/txo/tioFlows.spec.js +++ b/playwright/tests/office/txo/tioFlows.spec.js @@ -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(); @@ -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(); @@ -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(); diff --git a/playwright/tests/office/txo/tioUpdateMaxBillableWeight.spec.js b/playwright/tests/office/txo/tioUpdateMaxBillableWeight.spec.js index 37f55971460..0afaffa64a3 100644 --- a/playwright/tests/office/txo/tioUpdateMaxBillableWeight.spec.js +++ b/playwright/tests/office/txo/tioUpdateMaxBillableWeight.spec.js @@ -24,10 +24,10 @@ 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' }); + await page.getByRole('heading', { name: 'Review shipment weights' }).waitFor({ state: 'visible' }); await page.getByRole('button', { name: 'Edit' }).click(); await officePage.waitForLoading(); From 3460df7033e4f3beb26627a7d2fa9ab467c3f0e7 Mon Sep 17 00:00:00 2001 From: antgmann Date: Thu, 3 Oct 2024 18:08:56 +0000 Subject: [PATCH 3/4] Correct mistake --- playwright/tests/office/txo/tioUpdateMaxBillableWeight.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright/tests/office/txo/tioUpdateMaxBillableWeight.spec.js b/playwright/tests/office/txo/tioUpdateMaxBillableWeight.spec.js index 0afaffa64a3..df041d67fdb 100644 --- a/playwright/tests/office/txo/tioUpdateMaxBillableWeight.spec.js +++ b/playwright/tests/office/txo/tioUpdateMaxBillableWeight.spec.js @@ -27,7 +27,7 @@ test.describe('TIO user', () => { const reviewWeightsBtn = page.locator('#billable-weights').getByText('Review shipment weights'); await reviewWeightsBtn.click(); - await page.getByRole('heading', { name: 'Review shipment weights' }).waitFor({ state: 'visible' }); + await page.getByRole('heading', { name: 'Review weights' }).waitFor({ state: 'visible' }); await page.getByRole('button', { name: 'Edit' }).click(); await officePage.waitForLoading(); From d41e2a4262801e7e680a62766b3e69eb3563a3de Mon Sep 17 00:00:00 2001 From: antgmann Date: Thu, 3 Oct 2024 18:32:30 +0000 Subject: [PATCH 4/4] Additional test fix --- playwright/tests/office/txo/tooFlows.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright/tests/office/txo/tooFlows.spec.js b/playwright/tests/office/txo/tooFlows.spec.js index f857428c732..8ac83166971 100644 --- a/playwright/tests/office/txo/tooFlows.spec.js +++ b/playwright/tests/office/txo/tooFlows.spec.js @@ -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();