diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f75d288d..87d4a8686 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -204,6 +204,7 @@ * Create Jest/RTL test for `Limits`. Refs UIU-2399. * Create Jest/RTL test for `UserRequests`. Refs UIU-2306. * Create Jest/RTL test for `HelperApp`. Refs UIU-2310. +* Create Jest/RTL test for `constants`. Refs UIU-2316. ## [6.1.0](https://github.com/folio-org/ui-users/tree/v6.1.0) (2021-06-18) [Full Changelog](https://github.com/folio-org/ui-users/compare/v6.0.0...v6.1.0) diff --git a/src/constants.test.js b/src/constants.test.js new file mode 100644 index 000000000..423fd9f20 --- /dev/null +++ b/src/constants.test.js @@ -0,0 +1,48 @@ +import { refundClaimReturned, + requestStatuses, + itemStatuses, + loanStatuses, + accountStatuses, + loanActions, + loanActionMutators, + deliveryFulfillmentValues, + sortTypes, + statusFilter } from './constants'; + +/* Change the length of the imported constants in test files if constant files are changed */ + +describe('Constants', () => { + test('refundClaimReturned', () => { + expect(Object.keys(refundClaimReturned).length).toEqual(11); + }); + test('requestStatuses', () => { + expect(Object.keys(requestStatuses).length).toEqual(8); + }); + test('itemStatuses', () => { + expect(Object.keys(itemStatuses).length).toEqual(4); + }); + test('loanStatuses', () => { + expect(Object.keys(loanStatuses).length).toEqual(1); + }); + test('accountStatuses', () => { + expect(Object.keys(accountStatuses).length).toEqual(2); + }); + test('loanActions', () => { + expect(Object.keys(loanActions).length).toEqual(4); + }); + test('loanActionMutators', () => { + expect(Object.keys(loanActionMutators).length).toEqual(3); + }); + test('deliveryFulfillmentValues', () => { + expect(Object.keys(deliveryFulfillmentValues).length).toEqual(2); + }); + test('sortTypes', () => { + expect(Object.keys(sortTypes).length).toEqual(2); + }); + test('statusFilter', () => { + expect(Object.keys(statusFilter).length).toEqual(2); + }); + test('loanActions', () => { + expect(Object.keys(loanActions).length).toEqual(4); + }); +});