Skip to content

Commit

Permalink
test adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljordan-caci committed Feb 7, 2025
1 parent 4fedc40 commit f4ce771
Showing 1 changed file with 57 additions and 3 deletions.
60 changes: 57 additions & 3 deletions pkg/services/order/order_fetcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2537,6 +2537,26 @@ func (suite *OrderServiceSuite) TestListDestinationRequestsOrders() {
}, nil)

move3, shipment3 := buildMoveKKFA()
factory.BuildMTOServiceItem(suite.DB(), []factory.Customization{
{
Model: models.ReService{
Code: models.ReServiceCodeMS,
},
},
{
Model: move3,
LinkOnly: true,
},
{
Model: shipment3,
LinkOnly: true,
},
{
Model: models.MTOServiceItem{
Status: models.MTOServiceItemStatusApproved,
},
},
}, nil)
factory.BuildShipmentAddressUpdate(suite.DB(), []factory.Customization{
{
Model: shipment3,
Expand Down Expand Up @@ -2713,13 +2733,47 @@ func (suite *OrderServiceSuite) TestListDestinationRequestsOrders() {
},
}, nil)

move3, shipment3 := buildMoveZone4AK(usmc)
// we need to create a service item and attach it to the move/shipment
// else the query will exclude the move since it doesn't use LEFT JOINs
factory.BuildMTOServiceItem(suite.DB(), []factory.Customization{
{
Model: models.ReService{
Code: models.ReServiceCodeMS,
},
},
{
Model: move3,
LinkOnly: true,
},
{
Model: shipment3,
LinkOnly: true,
},
{
Model: models.MTOServiceItem{
Status: models.MTOServiceItemStatusApproved,
},
},
}, nil)
factory.BuildShipmentAddressUpdate(suite.DB(), []factory.Customization{
{
Model: shipment3,
LinkOnly: true,
},
{
Model: move3,
LinkOnly: true,
},
}, []factory.Trait{factory.GetTraitShipmentAddressUpdateRequested})

moves, moveCount, err := orderFetcher.ListDestinationRequestsOrders(
suite.AppContextWithSessionForTest(&session), officeUser.ID, roles.RoleTypeTOO, &services.ListOrderParams{},
)

// we should get both moves back since they're USMC moves and zone doesn't matter
// we should get three moves back since they're USMC moves and zone doesn't matter
suite.FatalNoError(err)
suite.Equal(2, moveCount)
suite.Len(moves, 2)
suite.Equal(3, moveCount)
suite.Len(moves, 3)
})
}

0 comments on commit f4ce771

Please sign in to comment.