-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add convertBands unit tests * Remove unused helper method (already in convert bands) * Remove unused helperMethods * Add helper methods unit test * Remove flow annotations from /utils - Not needed for such a small codebase, parameter types will be documented in JSDoc style doc strings * Remove flow related configuration - Remove dependancy from package.json - Remove flow config file, .flowconfig * Remove flow details in CONTRIBUTING.md * Add unit test for Sic code conversion
- Loading branch information
Showing
12 changed files
with
68 additions
and
131 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { employmentBands, legalStatusBands, tradingStatusBands, turnoverBands } from '../../src/utils/convertBands'; | ||
|
||
describe("Convert bands test suite", () => { | ||
it("converts an Employment Band to a number", () => { | ||
const conversion = employmentBands['A']; | ||
expect(conversion).toBe('0'); | ||
}); | ||
|
||
it("converts a Legal Status Band to a string", () => { | ||
const conversion = legalStatusBands['8']; | ||
expect(conversion).toBe('Charity'); | ||
}); | ||
|
||
it("converts a Trading Status Band to a string", () => { | ||
const conversion = tradingStatusBands['A']; | ||
expect(conversion).toBe('Active'); | ||
}); | ||
|
||
it("converts a Turnover Band to a string", () => { | ||
const conversion = turnoverBands['A']; | ||
expect(conversion).toBe('0-99'); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
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,10 @@ | ||
import { maxSize } from '../../src/utils/helperMethods'; | ||
|
||
describe("Helper Methods test suite", () => { | ||
it("gets the maxSize of given arrays", () => { | ||
const arr1 = [1, 2, 3]; | ||
const arr2 = [1]; | ||
const largest = maxSize(arr1, arr2); | ||
expect(largest).toBe(arr1.length); | ||
}); | ||
}); |
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,14 @@ | ||
import industryCodeDescription from '../../src/utils/siccode'; | ||
|
||
describe("Sic Code conversion test suite", () => { | ||
it("gets a Sic Code description from a valid Sic code", () => { | ||
const description = 'Growing of cereals (except rice), leguminous crops and oil seeds'; | ||
const conversion = industryCodeDescription['01110']; | ||
expect(conversion).toBe(description); | ||
}); | ||
|
||
it("returns undefined for a Sic code that doesn't exist", () => { | ||
const conversion = industryCodeDescription['1234567890']; | ||
expect(conversion).toBe(undefined); | ||
}); | ||
}); |