Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

B-22244-INT #14972

Open
wants to merge 6 commits into
base: integrationTesting
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions pkg/testdatagen/testharness/make_move.go
Original file line number Diff line number Diff line change
Expand Up @@ -11073,8 +11073,7 @@ func makeIntlHHGMoveDestAddressRequested(
factory.BuildMTOServiceItemBasic(appCtx.DB(), []factory.Customization{
{
Model: models.MTOServiceItem{
Status: models.MTOServiceItemStatusApproved,
MTOShipmentID: &shipmentAddressUpdate.Shipment.ID,
Status: models.MTOServiceItemStatusApproved,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was causing a DB error during service item re-calculation. I believe the MS Move Management service item should be linked to only the move, not the shipment. With this change the generated test shipment shows the Move Management service item in the MTO Service Items section instead of the shipment Approved Service Items which now matches shipments I made manually through the UI.

},
},
{
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 @@ -644,7 +644,7 @@ test.describe('TOO user', () => {

test('approves a delivery address change request for an HHG shipment', async ({ officePage, page }) => {
test.setTimeout(300000); // This one has been a headache forever. Shoehorn fix to go way above default "slow" timeout
const shipmentAddressUpdate = await officePage.testHarness.bulidHHGMoveWithAddressChangeRequest();
const shipmentAddressUpdate = await officePage.testHarness.buildHHGMoveWithAddressChangeRequest();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed a typo I noticed, "bulid" vs "build"

await officePage.signInAsNewTOOUser();
tooFlowPage = new TooFlowPage(officePage, shipmentAddressUpdate.Shipment.MoveTaskOrder);
await tooFlowPage.waitForLoading();
Expand Down
74 changes: 74 additions & 0 deletions playwright/tests/office/txo/tooFlowsInternational.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,4 +254,78 @@ test.describe('TOO user', () => {
requestedServiceItemCount = await getServiceItemsInTable(requestedServiceItemsTable).count();
});
});

test('approves a delivery address change request for an international HHG shipment', async ({ page, officePage }) => {
const originalStreet = 'Alaska Zone II St.';
const originalCity = 'North Pole';
const originalZip = '99705';
const updatedStreet = 'Another Cold St.';
const updatedCity = 'Juneau';
const updatedZip = '99811';
const move = await officePage.testHarness.buildIntlHHGMoveDestAddressRequestedAKZone2AirForce();
await officePage.signInAsNewTOOUser();
const moveLocator = move.locator;
tooFlowPage = new TooFlowPage(officePage, move);
await tooFlowPage.waitForLoading();
await officePage.tooNavigateToMove(moveLocator);

await expect(page.getByTestId('destinationAddress')).toContainText('Review required');

// Edit the shipment
await page.getByRole('button', { name: 'Edit shipment' }).click();
await expect(
page.getByTestId('alert').getByText('Request needs review. See delivery address to proceed.'),
).toBeVisible();
await expect(
page
.getByTestId('alert')
.getByText('Pending delivery address change request needs review. Review request to proceed.'),
).toBeVisible();
const originalDeliveryAddress = page.getByRole('group', { name: 'Delivery Address' });
await expect(originalDeliveryAddress.getByTestId('delivery.address.streetAddress1')).toHaveValue(originalStreet);
await expect(originalDeliveryAddress.getByTestId('City')).toHaveText(originalCity);
await expect(originalDeliveryAddress.getByTestId('State')).toHaveText('AK');
await expect(originalDeliveryAddress.getByTestId('ZIP')).toHaveText(originalZip);

// Click to trigger review modal
await page.getByRole('button', { name: 'Review request' }).click();
await expect(page.getByTestId('modal')).toBeVisible();

await expect(page.getByTestId('two-line-address').nth(0)).toContainText(originalStreet);
await expect(page.getByTestId('two-line-address').nth(0)).toContainText(originalCity);
await expect(page.getByTestId('two-line-address').nth(0)).toContainText(originalZip);
await expect(page.getByTestId('two-line-address').nth(1)).toContainText(updatedStreet);
await expect(page.getByTestId('two-line-address').nth(1)).toContainText(updatedCity);
await expect(page.getByTestId('two-line-address').nth(1)).toContainText(updatedZip);

// Enter information in modal and submit
await page.getByTestId('modal').getByTestId('radio').getByText('Yes').click();
await page
.getByTestId('modal')
.locator('textarea')
.fill('Approved for test TOO user approves a delivery address change request for an international HHG shipment');

// Click save on the modal
await page.getByTestId('modal').getByRole('button', { name: 'Save' }).click();
await expect(page.getByTestId('modal')).not.toBeVisible();

await expect(page.getByText('Changes sent to contractor.')).toBeVisible();
const deliveryAddress = page.getByRole('group', { name: 'Delivery Address' });
await expect(deliveryAddress.getByTestId('delivery.address.streetAddress1')).toHaveValue(updatedStreet);
await expect(deliveryAddress.getByTestId('City')).toHaveText(updatedCity);
await expect(deliveryAddress.getByTestId('State')).toHaveText('AK');
await expect(deliveryAddress.getByTestId('ZIP')).toHaveText(updatedZip);

// Click cancel on the Edit Shipment page
await page.getByRole('button', { name: 'Cancel' }).click();

await expect(page.getByText('Update request details')).not.toBeVisible();
await expect(page.getByText('Review required')).not.toBeVisible();
await expect(page.getByTestId('destinationAddress')).toContainText(updatedStreet);
await expect(page.getByTestId('destinationAddress')).toContainText(updatedCity);
await expect(page.getByTestId('destinationAddress')).toContainText(updatedZip);
await expect(page.getByText(originalStreet)).not.toBeVisible();
await expect(page.getByText(originalCity)).not.toBeVisible();
await expect(page.getByText(originalZip)).not.toBeVisible();
});
});
2 changes: 1 addition & 1 deletion playwright/tests/utils/testharness.js
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ export class TestHarness {
* @returns {Promise<Object>}
*/

async bulidHHGMoveWithAddressChangeRequest() {
async buildHHGMoveWithAddressChangeRequest() {
return this.buildDefault('HHGMoveWithAddressChangeRequest');
}

Expand Down