ffc-pay-schemes 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -9
- package/app/get-scheme-id-from-source-system.js +10 -0
- package/app/get-scheme-name-from-scheme-id.js +10 -0
- package/app/get-schemes.js +3 -1
- package/app/get-source-system-from-scheme-id.js +10 -0
- package/index.js +6 -0
- package/package.json +1 -1
- package/sonar-project.properties +2 -2
- package/test/unit/get-scheme-id-from-source-system.test.js +50 -0
- package/test/unit/get-scheme-name-from-scheme-id.test.js +50 -0
- package/test/unit/get-schemes.test.js +5 -2
- package/test/unit/get-source-system-from-scheme-id.test.js +50 -0
- package/test-output/cobertura-coverage.xml +74 -7
- package/test-output/junit.xml +288 -258
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/account-codes/ap.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/account-codes/ar-admin.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/account-codes/ar-irregular.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/account-codes/index.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/delivery-bodies.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/description-codes.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/fund-codes.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/index.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/pillars.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/scheme-batch-properties.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/scheme-ids.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/scheme-names.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/schemes-not-requiring-ppas.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/schemes-providing-account-values.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/schemes.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/source-systems.js.html +2 -2
- package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/create-default-invoice-number.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/create-es-invoice-number.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/create-imps-invoice-number.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/create-siti-agri-invoice-number.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/create-standard-scheme-invoice-number.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/index.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/index.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/use-invoice-number-as-is.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/create-split-invoice-number/create-default-invoice-number.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/create-split-invoice-number/create-siti-agri-invoice-number.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/create-split-invoice-number/index.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/create-split-invoice-number/index.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/bps-map.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/cohtc-map.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/cs-map.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/default-map.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/delinked-map.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/index.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/index.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/lump-sums-map.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/sfi-frps-map.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/vet-visits-map.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-scheme-batch-properties.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-scheme-id-from-source-system.js.html +115 -0
- package/test-output/lcov-report/ffc-pay-schemes/app/get-scheme-name-from-scheme-id.js.html +115 -0
- package/test-output/lcov-report/ffc-pay-schemes/app/get-scheme-name.js.html +115 -0
- package/test-output/lcov-report/ffc-pay-schemes/app/get-scheme-properties.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-schemes.js.html +11 -5
- package/test-output/lcov-report/ffc-pay-schemes/app/get-source-system-from-scheme-id.js.html +115 -0
- package/test-output/lcov-report/ffc-pay-schemes/app/get-source-system.js.html +115 -0
- package/test-output/lcov-report/ffc-pay-schemes/app/index.html +49 -4
- package/test-output/lcov-report/ffc-pay-schemes/app/scheme-does-not-require-ppas.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/scheme-provides-accounting-values.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/index.html +5 -5
- package/test-output/lcov-report/ffc-pay-schemes/index.js.html +22 -4
- package/test-output/lcov-report/index.html +11 -11
- package/test-output/lcov.info +65 -7
package/README.md
CHANGED
|
@@ -18,25 +18,30 @@ const {
|
|
|
18
18
|
createSplitInvoiceNumber,
|
|
19
19
|
getAccountCodeMap,
|
|
20
20
|
getSchemeBatchProperties,
|
|
21
|
+
getSchemeNameFromSchemeId,
|
|
21
22
|
getSchemeProperties,
|
|
22
23
|
getSchemes,
|
|
24
|
+
getSourceSystemFromSchemeId,
|
|
23
25
|
schemeDoesNotRequirePPAs,
|
|
24
26
|
schemeProvidesAccountingValues,
|
|
25
27
|
schemeIds
|
|
26
28
|
} = require('ffc-pay-schemes')
|
|
27
29
|
```
|
|
28
30
|
|
|
29
|
-
- `getSchemes()` returns all supported schemes as an array of objects containing `schemeId` and `schemeName`.
|
|
30
|
-
- `getSchemeProperties(schemeId, sourceSystem, pillar)` returns the properties for a scheme. A scheme can be identified by its ID or source system. The optional `pillar` can be used for manual payments.
|
|
31
|
-
- `getSchemeBatchProperties(schemeId)` returns the batch processing properties for a given `schemeId`.
|
|
32
|
-
- `getAccountCodeMap(schemeId)` returns the account code mapping used for a given `schemeId`.
|
|
33
31
|
- `createInvoiceNumber(paymentRequest)` creates an invoice number for a given `paymentRequest`.
|
|
34
32
|
- `createSplitInvoiceNumber(paymentRequest)` creates a split invoice number for a given `paymentRequest`.
|
|
33
|
+
- `getAccountCodeMap(schemeId)` returns the account code mapping used for a given `schemeId`.
|
|
34
|
+
- `getSchemeBatchProperties(schemeId)` returns the batch processing properties for a given `schemeId`.
|
|
35
|
+
- `getSchemeIdFromSourceSystem(sourceSystem)` returns the scheme ID for a given `sourceSystem`.
|
|
36
|
+
- `getSchemeNameFromSchemeId(schemeId)` returns the scheme name for a given `schemeId`.
|
|
37
|
+
- `getSchemeProperties(schemeId, sourceSystem, pillar)` returns the default payment properties for a scheme. A scheme can be identified by its ID or source system. The optional `pillar` can be used for manual payments.
|
|
38
|
+
- `getSchemes()` returns all supported schemes as an array of objects containing `schemeId`, `schemeName` and `sourceSystem`.
|
|
39
|
+
- `getSourceSystemFromSchemeId(schemeId)` returns the source system name for a given `schemeId`.
|
|
35
40
|
- `schemeDoesNotRequirePPAs(schemeId)` returns `true` if Payment Hub does not support Post Payment Adjustments (PPAs) for a given `schemeId`; otherwise, it returns `false`.
|
|
36
41
|
- `schemeProvidesAccountingValues(schemeId)` returns `true` if a given `schemeId` provides accounting values within its payment requests; otherwise, it returns `false`.
|
|
37
42
|
- `schemeIds` provides the constants for all supported scheme IDs.
|
|
38
43
|
|
|
39
|
-
###
|
|
44
|
+
### Examples
|
|
40
45
|
|
|
41
46
|
```js
|
|
42
47
|
const {
|
|
@@ -48,15 +53,11 @@ const {
|
|
|
48
53
|
} = require('ffc-pay-schemes')
|
|
49
54
|
|
|
50
55
|
const schemes = getSchemes()
|
|
51
|
-
console.log(schemes)
|
|
52
56
|
|
|
53
57
|
const scheme = getSchemeProperties(schemeIds.BPS)
|
|
54
|
-
console.log(scheme)
|
|
55
58
|
|
|
56
59
|
const doesNotRequirePPAs = schemeDoesNotRequirePPAs(schemeIds.BPS)
|
|
57
60
|
const providesAccountingValues = schemeProvidesAccountingValues(schemeIds.BPS)
|
|
58
|
-
|
|
59
|
-
console.log({ doesNotRequirePPAs, providesAccountingValues })
|
|
60
61
|
```
|
|
61
62
|
|
|
62
63
|
## Licence
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const { getSchemes } = require('./get-schemes')
|
|
2
|
+
|
|
3
|
+
const getSchemeIdFromSourceSystem = (sourceSystem) => {
|
|
4
|
+
const matchingScheme = getSchemes().find((scheme) => scheme.sourceSystem === sourceSystem)
|
|
5
|
+
return matchingScheme?.schemeId
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
module.exports = {
|
|
9
|
+
getSchemeIdFromSourceSystem
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const { getSchemes } = require('./get-schemes')
|
|
2
|
+
|
|
3
|
+
const getSchemeNameFromSchemeId = (schemeId) => {
|
|
4
|
+
const matchingScheme = getSchemes().find((scheme) => scheme.schemeId === schemeId)
|
|
5
|
+
return matchingScheme?.schemeName
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
module.exports = {
|
|
9
|
+
getSchemeNameFromSchemeId
|
|
10
|
+
}
|
package/app/get-schemes.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
const schemeIds = require('./constants/scheme-ids')
|
|
2
2
|
const schemeNames = require('./constants/scheme-names')
|
|
3
|
+
const sourceSystems = require('./constants/source-systems')
|
|
3
4
|
|
|
4
5
|
const getSchemes = () =>
|
|
5
6
|
Object.keys(schemeIds).map((schemeKey) => ({
|
|
6
7
|
schemeId: schemeIds[schemeKey],
|
|
7
|
-
schemeName: schemeNames[schemeKey]
|
|
8
|
+
schemeName: schemeNames[schemeKey],
|
|
9
|
+
sourceSystem: sourceSystems[schemeKey]
|
|
8
10
|
}))
|
|
9
11
|
|
|
10
12
|
module.exports = {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const { getSchemes } = require('./get-schemes')
|
|
2
|
+
|
|
3
|
+
const getSourceSystemFromSchemeId = (schemeId) => {
|
|
4
|
+
const matchingScheme = getSchemes().find((scheme) => scheme.schemeId === schemeId)
|
|
5
|
+
return matchingScheme?.sourceSystem
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
module.exports = {
|
|
9
|
+
getSourceSystemFromSchemeId
|
|
10
|
+
}
|
package/index.js
CHANGED
|
@@ -2,8 +2,11 @@ const { createInvoiceNumber } = require('./app/create-invoice-number')
|
|
|
2
2
|
const { createSplitInvoiceNumber } = require('./app/create-split-invoice-number')
|
|
3
3
|
const { getAccountCodeMap } = require('./app/get-account-code-map')
|
|
4
4
|
const { getSchemeBatchProperties } = require('./app/get-scheme-batch-properties')
|
|
5
|
+
const { getSchemeIdFromSourceSystem } = require('./app/get-scheme-id-from-source-system')
|
|
6
|
+
const { getSchemeNameFromSchemeId } = require('./app/get-scheme-name-from-scheme-id')
|
|
5
7
|
const { getSchemeProperties } = require('./app/get-scheme-properties')
|
|
6
8
|
const { getSchemes } = require('./app/get-schemes')
|
|
9
|
+
const { getSourceSystemFromSchemeId } = require('./app/get-source-system-from-scheme-id')
|
|
7
10
|
const { schemeDoesNotRequirePPAs } = require('./app/scheme-does-not-require-ppas')
|
|
8
11
|
const { schemeProvidesAccountingValues } = require('./app/scheme-provides-accounting-values')
|
|
9
12
|
const schemeIds = require('./app/constants/scheme-ids')
|
|
@@ -13,8 +16,11 @@ module.exports = {
|
|
|
13
16
|
createSplitInvoiceNumber,
|
|
14
17
|
getAccountCodeMap,
|
|
15
18
|
getSchemeBatchProperties,
|
|
19
|
+
getSchemeIdFromSourceSystem,
|
|
20
|
+
getSchemeNameFromSchemeId,
|
|
16
21
|
getSchemeProperties,
|
|
17
22
|
getSchemes,
|
|
23
|
+
getSourceSystemFromSchemeId,
|
|
18
24
|
schemeDoesNotRequirePPAs,
|
|
19
25
|
schemeProvidesAccountingValues,
|
|
20
26
|
schemeIds
|
package/package.json
CHANGED
package/sonar-project.properties
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
sonar.javascript.exclusions=**/jest.config.js,**/jest.setup.js,**/__mocks__/**,**/node_modules/**,**/test/**,**/test-output/**,**/eslint.config.js
|
|
1
|
+
sonar.javascript.exclusions=**/jest.config.js,**/jest.setup.js,**/__mocks__/**,**/node_modules/**,**/test/**,**/test-output/**,**/eslint.config.js,index.js
|
|
2
2
|
sonar.javascript.lcov.reportPaths=test-output/lcov.info
|
|
3
|
-
sonar.exclusions=/test/**,**/*.test.js,*snyk_report.html,*snyk_report.css
|
|
3
|
+
sonar.exclusions=/test/**,**/*.test.js,*snyk_report.html,*snyk_report.css,README.md
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
jest.mock('../../app/get-schemes', () => ({
|
|
2
|
+
getSchemes: jest.fn()
|
|
3
|
+
}))
|
|
4
|
+
|
|
5
|
+
const { getSchemes } = require('../../app/get-schemes')
|
|
6
|
+
const { getSchemeIdFromSourceSystem } = require('../../app/get-scheme-id-from-source-system')
|
|
7
|
+
|
|
8
|
+
describe('getSchemeIdFromSourceSystem', () => {
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
jest.clearAllMocks()
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
test('returns the schemeId for a matching source system', () => {
|
|
14
|
+
getSchemes.mockReturnValue([
|
|
15
|
+
{
|
|
16
|
+
schemeId: 1,
|
|
17
|
+
schemeName: 'Example Scheme',
|
|
18
|
+
sourceSystem: 'Example Source'
|
|
19
|
+
}
|
|
20
|
+
])
|
|
21
|
+
|
|
22
|
+
expect(getSchemeIdFromSourceSystem('Example Source')).toBe(1)
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
test('returns undefined when the source system is not found', () => {
|
|
26
|
+
getSchemes.mockReturnValue([
|
|
27
|
+
{
|
|
28
|
+
schemeId: 1,
|
|
29
|
+
schemeName: 'Example Scheme',
|
|
30
|
+
sourceSystem: 'Example Source'
|
|
31
|
+
}
|
|
32
|
+
])
|
|
33
|
+
|
|
34
|
+
expect(getSchemeIdFromSourceSystem('Not a real source')).toBeUndefined()
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
test('returns undefined when no schemes are available', () => {
|
|
38
|
+
getSchemes.mockReturnValue([])
|
|
39
|
+
|
|
40
|
+
expect(getSchemeIdFromSourceSystem('Not a real source')).toBeUndefined()
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
test('gets schemes before searching for the source system', () => {
|
|
44
|
+
getSchemes.mockReturnValue([])
|
|
45
|
+
|
|
46
|
+
getSchemeIdFromSourceSystem('Not a real source')
|
|
47
|
+
|
|
48
|
+
expect(getSchemes).toHaveBeenCalledTimes(1)
|
|
49
|
+
})
|
|
50
|
+
})
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
jest.mock('../../app/get-schemes', () => ({
|
|
2
|
+
getSchemes: jest.fn()
|
|
3
|
+
}))
|
|
4
|
+
|
|
5
|
+
const { getSchemes } = require('../../app/get-schemes')
|
|
6
|
+
const { getSchemeNameFromSchemeId } = require('../../app/get-scheme-name-from-scheme-id')
|
|
7
|
+
|
|
8
|
+
describe('getSchemeNameFromSchemeId', () => {
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
jest.clearAllMocks()
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
test('returns the source system for a matching scheme ID', () => {
|
|
14
|
+
getSchemes.mockReturnValue([
|
|
15
|
+
{
|
|
16
|
+
schemeId: 1,
|
|
17
|
+
schemeName: 'Example Scheme',
|
|
18
|
+
sourceSystem: 'Example Source'
|
|
19
|
+
}
|
|
20
|
+
])
|
|
21
|
+
|
|
22
|
+
expect(getSchemeNameFromSchemeId(1)).toBe('Example Scheme')
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
test('returns undefined when the scheme ID is not found', () => {
|
|
26
|
+
getSchemes.mockReturnValue([
|
|
27
|
+
{
|
|
28
|
+
schemeId: 1,
|
|
29
|
+
schemeName: 'Example Scheme',
|
|
30
|
+
sourceSystem: 'Example Source'
|
|
31
|
+
}
|
|
32
|
+
])
|
|
33
|
+
|
|
34
|
+
expect(getSchemeNameFromSchemeId(2)).toBeUndefined()
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
test('returns undefined when no schemes are available', () => {
|
|
38
|
+
getSchemes.mockReturnValue([])
|
|
39
|
+
|
|
40
|
+
expect(getSchemeNameFromSchemeId(2)).toBeUndefined()
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
test('gets schemes before searching for the source system', () => {
|
|
44
|
+
getSchemes.mockReturnValue([])
|
|
45
|
+
|
|
46
|
+
getSchemeNameFromSchemeId(2)
|
|
47
|
+
|
|
48
|
+
expect(getSchemes).toHaveBeenCalledTimes(1)
|
|
49
|
+
})
|
|
50
|
+
})
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
const { getSchemes } = require('../../app/get-schemes')
|
|
2
2
|
const schemeIds = require('../../app/constants/scheme-ids')
|
|
3
3
|
const schemeNames = require('../../app/constants/scheme-names')
|
|
4
|
+
const sourceSystems = require('../../app/constants/source-systems')
|
|
4
5
|
|
|
5
6
|
describe('getSchemes', () => {
|
|
6
7
|
test('returns all schemes with their IDs and names', () => {
|
|
7
8
|
expect(getSchemes()).toEqual(
|
|
8
9
|
Object.keys(schemeIds).map((schemeKey) => ({
|
|
9
10
|
schemeId: schemeIds[schemeKey],
|
|
10
|
-
schemeName: schemeNames[schemeKey]
|
|
11
|
+
schemeName: schemeNames[schemeKey],
|
|
12
|
+
sourceSystem: sourceSystems[schemeKey]
|
|
11
13
|
}))
|
|
12
14
|
)
|
|
13
15
|
})
|
|
@@ -17,7 +19,8 @@ describe('getSchemes', () => {
|
|
|
17
19
|
(schemeKey) => {
|
|
18
20
|
expect(getSchemes()).toContainEqual({
|
|
19
21
|
schemeId: schemeIds[schemeKey],
|
|
20
|
-
schemeName: schemeNames[schemeKey]
|
|
22
|
+
schemeName: schemeNames[schemeKey],
|
|
23
|
+
sourceSystem: sourceSystems[schemeKey]
|
|
21
24
|
})
|
|
22
25
|
}
|
|
23
26
|
)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
jest.mock('../../app/get-schemes', () => ({
|
|
2
|
+
getSchemes: jest.fn()
|
|
3
|
+
}))
|
|
4
|
+
|
|
5
|
+
const { getSchemes } = require('../../app/get-schemes')
|
|
6
|
+
const { getSourceSystemFromSchemeId } = require('../../app/get-source-system-from-scheme-id')
|
|
7
|
+
|
|
8
|
+
describe('getSourceSystemFromSchemeId', () => {
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
jest.clearAllMocks()
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
test('returns the source system for a matching scheme ID', () => {
|
|
14
|
+
getSchemes.mockReturnValue([
|
|
15
|
+
{
|
|
16
|
+
schemeId: 1,
|
|
17
|
+
schemeName: 'Example Scheme',
|
|
18
|
+
sourceSystem: 'Example Source'
|
|
19
|
+
}
|
|
20
|
+
])
|
|
21
|
+
|
|
22
|
+
expect(getSourceSystemFromSchemeId(1)).toBe('Example Source')
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
test('returns undefined when the scheme ID is not found', () => {
|
|
26
|
+
getSchemes.mockReturnValue([
|
|
27
|
+
{
|
|
28
|
+
schemeId: 1,
|
|
29
|
+
schemeName: 'Example Scheme',
|
|
30
|
+
sourceSystem: 'Example Source'
|
|
31
|
+
}
|
|
32
|
+
])
|
|
33
|
+
|
|
34
|
+
expect(getSourceSystemFromSchemeId(2)).toBeUndefined()
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
test('returns undefined when no schemes are available', () => {
|
|
38
|
+
getSchemes.mockReturnValue([])
|
|
39
|
+
|
|
40
|
+
expect(getSourceSystemFromSchemeId(2)).toBeUndefined()
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
test('gets schemes before searching for the source system', () => {
|
|
44
|
+
getSchemes.mockReturnValue([])
|
|
45
|
+
|
|
46
|
+
getSourceSystemFromSchemeId(2)
|
|
47
|
+
|
|
48
|
+
expect(getSchemes).toHaveBeenCalledTimes(1)
|
|
49
|
+
})
|
|
50
|
+
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" ?>
|
|
2
2
|
<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
|
|
3
|
-
<coverage lines-valid="
|
|
3
|
+
<coverage lines-valid="220" lines-covered="207" line-rate="0.9409000000000001" branches-valid="50" branches-covered="50" branch-rate="1" timestamp="1787762739854" complexity="0" version="0.1">
|
|
4
4
|
<sources>
|
|
5
5
|
<source>/home/samplackett/ffc-pay-schemes</source>
|
|
6
6
|
</sources>
|
|
@@ -20,7 +20,10 @@
|
|
|
20
20
|
<line number="7" hits="0" branch="false"/>
|
|
21
21
|
<line number="8" hits="0" branch="false"/>
|
|
22
22
|
<line number="9" hits="0" branch="false"/>
|
|
23
|
+
<line number="10" hits="0" branch="false"/>
|
|
23
24
|
<line number="11" hits="0" branch="false"/>
|
|
25
|
+
<line number="12" hits="0" branch="false"/>
|
|
26
|
+
<line number="14" hits="0" branch="false"/>
|
|
24
27
|
</lines>
|
|
25
28
|
</class>
|
|
26
29
|
</classes>
|
|
@@ -47,6 +50,48 @@
|
|
|
47
50
|
<line number="7" hits="1" branch="false"/>
|
|
48
51
|
</lines>
|
|
49
52
|
</class>
|
|
53
|
+
<class name="get-scheme-id-from-source-system.js" filename="app/get-scheme-id-from-source-system.js" line-rate="1" branch-rate="1">
|
|
54
|
+
<methods>
|
|
55
|
+
<method name="(anonymous_0)" hits="4" signature="()V">
|
|
56
|
+
<lines>
|
|
57
|
+
<line number="3" hits="4"/>
|
|
58
|
+
</lines>
|
|
59
|
+
</method>
|
|
60
|
+
<method name="(anonymous_1)" hits="2" signature="()V">
|
|
61
|
+
<lines>
|
|
62
|
+
<line number="4" hits="2"/>
|
|
63
|
+
</lines>
|
|
64
|
+
</method>
|
|
65
|
+
</methods>
|
|
66
|
+
<lines>
|
|
67
|
+
<line number="1" hits="1" branch="false"/>
|
|
68
|
+
<line number="3" hits="1" branch="false"/>
|
|
69
|
+
<line number="4" hits="4" branch="false"/>
|
|
70
|
+
<line number="5" hits="4" branch="false"/>
|
|
71
|
+
<line number="8" hits="1" branch="false"/>
|
|
72
|
+
</lines>
|
|
73
|
+
</class>
|
|
74
|
+
<class name="get-scheme-name-from-scheme-id.js" filename="app/get-scheme-name-from-scheme-id.js" line-rate="1" branch-rate="1">
|
|
75
|
+
<methods>
|
|
76
|
+
<method name="(anonymous_0)" hits="4" signature="()V">
|
|
77
|
+
<lines>
|
|
78
|
+
<line number="3" hits="4"/>
|
|
79
|
+
</lines>
|
|
80
|
+
</method>
|
|
81
|
+
<method name="(anonymous_1)" hits="2" signature="()V">
|
|
82
|
+
<lines>
|
|
83
|
+
<line number="4" hits="2"/>
|
|
84
|
+
</lines>
|
|
85
|
+
</method>
|
|
86
|
+
</methods>
|
|
87
|
+
<lines>
|
|
88
|
+
<line number="1" hits="1" branch="false"/>
|
|
89
|
+
<line number="3" hits="1" branch="false"/>
|
|
90
|
+
<line number="4" hits="4" branch="false"/>
|
|
91
|
+
<line number="5" hits="4" branch="false"/>
|
|
92
|
+
<line number="8" hits="1" branch="false"/>
|
|
93
|
+
</lines>
|
|
94
|
+
</class>
|
|
50
95
|
<class name="get-scheme-properties.js" filename="app/get-scheme-properties.js" line-rate="1" branch-rate="1">
|
|
51
96
|
<methods>
|
|
52
97
|
<method name="(anonymous_0)" hits="54" signature="()V">
|
|
@@ -91,21 +136,43 @@
|
|
|
91
136
|
<methods>
|
|
92
137
|
<method name="(anonymous_0)" hits="18" signature="()V">
|
|
93
138
|
<lines>
|
|
94
|
-
<line number="
|
|
139
|
+
<line number="5" hits="18"/>
|
|
95
140
|
</lines>
|
|
96
141
|
</method>
|
|
97
142
|
<method name="(anonymous_1)" hits="306" signature="()V">
|
|
98
143
|
<lines>
|
|
99
|
-
<line number="
|
|
144
|
+
<line number="6" hits="306"/>
|
|
100
145
|
</lines>
|
|
101
146
|
</method>
|
|
102
147
|
</methods>
|
|
103
148
|
<lines>
|
|
104
149
|
<line number="1" hits="1" branch="false"/>
|
|
105
150
|
<line number="2" hits="1" branch="false"/>
|
|
106
|
-
<line number="
|
|
107
|
-
<line number="5" hits="
|
|
108
|
-
<line number="
|
|
151
|
+
<line number="3" hits="1" branch="false"/>
|
|
152
|
+
<line number="5" hits="1" branch="false"/>
|
|
153
|
+
<line number="6" hits="306" branch="false"/>
|
|
154
|
+
<line number="12" hits="1" branch="false"/>
|
|
155
|
+
</lines>
|
|
156
|
+
</class>
|
|
157
|
+
<class name="get-source-system-from-scheme-id.js" filename="app/get-source-system-from-scheme-id.js" line-rate="1" branch-rate="1">
|
|
158
|
+
<methods>
|
|
159
|
+
<method name="(anonymous_0)" hits="4" signature="()V">
|
|
160
|
+
<lines>
|
|
161
|
+
<line number="3" hits="4"/>
|
|
162
|
+
</lines>
|
|
163
|
+
</method>
|
|
164
|
+
<method name="(anonymous_1)" hits="2" signature="()V">
|
|
165
|
+
<lines>
|
|
166
|
+
<line number="4" hits="2"/>
|
|
167
|
+
</lines>
|
|
168
|
+
</method>
|
|
169
|
+
</methods>
|
|
170
|
+
<lines>
|
|
171
|
+
<line number="1" hits="1" branch="false"/>
|
|
172
|
+
<line number="3" hits="1" branch="false"/>
|
|
173
|
+
<line number="4" hits="4" branch="false"/>
|
|
174
|
+
<line number="5" hits="4" branch="false"/>
|
|
175
|
+
<line number="8" hits="1" branch="false"/>
|
|
109
176
|
</lines>
|
|
110
177
|
</class>
|
|
111
178
|
<class name="scheme-does-not-require-ppas.js" filename="app/scheme-does-not-require-ppas.js" line-rate="1" branch-rate="1">
|
|
@@ -224,7 +291,7 @@
|
|
|
224
291
|
<methods>
|
|
225
292
|
</methods>
|
|
226
293
|
<lines>
|
|
227
|
-
<line number="1" hits="
|
|
294
|
+
<line number="1" hits="3" branch="false"/>
|
|
228
295
|
</lines>
|
|
229
296
|
</class>
|
|
230
297
|
</classes>
|