feat(approval): add task workflow and waiver decisions
This commit is contained in:
@@ -1,18 +1,17 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { join } from 'node:path'
|
||||
import test from 'node:test'
|
||||
|
||||
const root = process.cwd()
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
function readProjectFile(path) {
|
||||
return readFileSync(join(root, path), 'utf8')
|
||||
return readFileSync(fileURLToPath(new URL(`../${path.replace(/^web\//, '')}`, import.meta.url)), 'utf8')
|
||||
}
|
||||
|
||||
test('workbench and document list refreshes use preview pagination', () => {
|
||||
test('claim previews stay bounded while document review uses the approval task workspace', () => {
|
||||
const useRequests = readProjectFile('web/src/composables/useRequests.js')
|
||||
const useAppShell = readProjectFile('web/src/composables/useAppShell.js')
|
||||
const documentsCenter = readProjectFile('web/src/views/DocumentsCenterView.vue')
|
||||
const archiveRowsComposable = readProjectFile('web/src/composables/useDocumentCenterArchiveRows.js')
|
||||
const approvalCenter = readProjectFile('web/src/views/scripts/ApprovalCenterView.js')
|
||||
const archiveCenter = readProjectFile('web/src/views/scripts/ArchiveCenterView.js')
|
||||
|
||||
@@ -24,8 +23,9 @@ test('workbench and document list refreshes use preview pagination', () => {
|
||||
assert.match(useAppShell, /fetchApprovalExpenseClaims\(REIMBURSEMENT_LIST_PREVIEW_PARAMS\)/)
|
||||
assert.doesNotMatch(useAppShell, /fetchAllApprovalExpenseClaims\(\)/)
|
||||
|
||||
assert.match(documentsCenter, /fetchApprovalExpenseClaims\(REIMBURSEMENT_LIST_PREVIEW_PARAMS\)/)
|
||||
assert.match(documentsCenter, /fetchArchivedExpenseClaims\(REIMBURSEMENT_LIST_PREVIEW_PARAMS\)/)
|
||||
assert.match(archiveRowsComposable, /fetchArchivedExpenseClaims\(REIMBURSEMENT_LIST_PREVIEW_PARAMS\)/)
|
||||
assert.match(documentsCenter, /<ApprovalTaskWorkspace/)
|
||||
assert.doesNotMatch(documentsCenter, /fetchApprovalExpenseClaims/)
|
||||
assert.doesNotMatch(documentsCenter, /fetchAllApprovalExpenseClaims\(\)/)
|
||||
assert.doesNotMatch(documentsCenter, /fetchAllArchivedExpenseClaims\(\)/)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user