-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(procedures): Add counters for completed/total documents in Overview
- Loading branch information
1 parent
c8f9a68
commit 4a0bd23
Showing
4 changed files
with
72 additions
and
5 deletions.
There are no files selected for viewing
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
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
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
40 changes: 40 additions & 0 deletions
40
packages/cozy-procedures/src/redux/documentsDataSlice.spec.js
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,40 @@ | ||
import { getCompletedDocumentsCount } from './documentsDataSlice' | ||
|
||
describe('documentsDataSlice', () => { | ||
describe('getCompletedDocumentsCount', () => { | ||
it('should return the number of completed documents', () => { | ||
const state = { | ||
documents: { | ||
data: { | ||
address_certificate: { | ||
files: [ | ||
{ | ||
id: 'baac72edf28acadd', | ||
name: 'facture_edf.pdf', | ||
trashed: false | ||
}, | ||
{ | ||
id: '94bbda9a86b52c76', | ||
name: 'facture_fibre.pdf', | ||
trashed: false | ||
} | ||
] | ||
}, | ||
bank_identity: { files: [] }, | ||
identity_document: { | ||
files: [ | ||
{ | ||
id: '979469aa60434433', | ||
name: 'carte_identite.png', | ||
trashed: false | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
const result = getCompletedDocumentsCount(state) | ||
expect(result).toEqual(3) | ||
}) | ||
}) | ||
}) |