-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9495 from transcom/ruizaj-mb-14399-updateMoveTask…
…OrderStatus-refactor [MB-14399] update move task order status refactor
- Loading branch information
Showing
5 changed files
with
44 additions
and
53 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
...stants/MoveHistory/EventTemplates/UpdateMoveTaskOrderStatus/updateMoveTaskOrderStatus.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react'; | ||
|
||
import o from 'constants/MoveHistory/UIDisplay/Operations'; | ||
import a from 'constants/MoveHistory/Database/Actions'; | ||
import t from 'constants/MoveHistory/Database/Tables'; | ||
|
||
export default { | ||
action: a.UPDATE, | ||
eventName: o.updateMoveTaskOrderStatus, | ||
tableName: t.moves, | ||
getEventNameDisplay: () => 'Approved move', | ||
getDetails: () => <> Created Move Task Order (MTO) </>, | ||
}; |
30 changes: 30 additions & 0 deletions
30
...s/MoveHistory/EventTemplates/UpdateMoveTaskOrderStatus/updateMoveTaskOrderStatus.test.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { render, screen } from '@testing-library/react'; | ||
|
||
import getTemplate from 'constants/MoveHistory/TemplateManager'; | ||
import e from 'constants/MoveHistory/EventTemplates/UpdateMoveTaskOrderStatus/updateMoveTaskOrderStatus'; | ||
|
||
describe('when given a Move approved history record', () => { | ||
const historyRecord = { | ||
action: 'UPDATE', | ||
changedValues: { | ||
available_to_prime_at: '2022-04-13T15:21:31.746028+00:00', | ||
status: 'APPROVED', | ||
}, | ||
eventName: 'updateMoveTaskOrderStatus', | ||
tableName: 'moves', | ||
}; | ||
|
||
it('correctly matches the Update move task order to the proper template', () => { | ||
const template = getTemplate(historyRecord); | ||
expect(template).toMatchObject(e); | ||
}); | ||
|
||
it('displays the correct value in the event name and details column', () => { | ||
const template = getTemplate(historyRecord); | ||
|
||
render(template.getEventNameDisplay(historyRecord)); | ||
render(template.getDetails(historyRecord)); | ||
expect(screen.getByText('Approved move')); | ||
expect(screen.getByText('Created Move Task Order (MTO)')); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
src/constants/MoveHistory/EventTemplates/updateMoveTaskOrderStatus.js
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
src/constants/MoveHistory/EventTemplates/updateMoveTaskOrderStatus.test.js
This file was deleted.
Oops, something went wrong.