@socialgouv/kali-data 2.615.0 → 2.617.0

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.
Files changed (35) hide show
  1. package/data/KALICONT000005635206.json +157 -27
  2. package/data/KALICONT000005635472.json +0 -1
  3. package/data/KALICONT000005635624.json +2 -2
  4. package/data/KALICONT000005635905.json +0 -1
  5. package/data/index.json +14 -42
  6. package/package.json +78 -77
  7. package/src/__tests__/index.test.js +15 -15
  8. package/src/helpers/__tests__/checkArticleIdOrCid.test.js +8 -8
  9. package/src/helpers/__tests__/isFile.test.js +14 -14
  10. package/src/helpers/checkArticleIdOrCid.js +6 -6
  11. package/src/helpers/isFile.js +1 -1
  12. package/src/helpers/withArticleIdOrCid.js +2 -2
  13. package/src/index.js +11 -11
  14. package/src/libs/__tests__/getAgreement.test.js +28 -28
  15. package/src/libs/__tests__/getAgreementArticlesWithParentSections.test.js +13 -13
  16. package/src/libs/__tests__/getAgreementArticlesWithPath.test.js +13 -13
  17. package/src/libs/__tests__/getAgreementIdFromIdOrIdcc.test.js +17 -17
  18. package/src/libs/__tests__/getAgreements.test.js +3 -3
  19. package/src/libs/__tests__/getArticleWithParentSections.test.js +19 -19
  20. package/src/libs/__tests__/getArticleWithPath.test.js +19 -19
  21. package/src/libs/__tests__/getArticles.test.js +3 -3
  22. package/src/libs/__tests__/getIndexedArticle.test.js +19 -19
  23. package/src/libs/__tests__/hasAgreement.test.js +23 -23
  24. package/src/libs/__tests__/hasArticle.test.js +14 -14
  25. package/src/libs/getAgreement.js +7 -7
  26. package/src/libs/getAgreementArticlesWithParentSections.js +22 -22
  27. package/src/libs/getAgreementArticlesWithPath.js +11 -11
  28. package/src/libs/getAgreementIdFromIdOrIdcc.js +18 -18
  29. package/src/libs/getAgreements.js +3 -3
  30. package/src/libs/getArticleWithParentSections.js +34 -34
  31. package/src/libs/getArticleWithPath.js +25 -25
  32. package/src/libs/getArticles.js +3 -3
  33. package/src/libs/getIndexedArticle.js +6 -6
  34. package/src/libs/hasAgreement.js +10 -9
  35. package/src/libs/hasArticle.js +6 -6
package/package.json CHANGED
@@ -1,80 +1,81 @@
1
1
  {
2
- "name": "@socialgouv/kali-data",
3
- "version": "2.615.0",
4
- "dependencies": {
5
- "csv-parser": "^3.0.0",
6
- "node-xlsx": "^0.23.0",
7
- "unist-util-find": "1.0.4",
8
- "unist-util-flat-filter": "1.0.0",
9
- "unist-util-parents": "1.0.3"
10
- },
11
- "devDependencies": {
12
- "@babel/core": "^7.16.0",
13
- "@babel/plugin-transform-modules-commonjs": "^7.16.0",
14
- "@babel/preset-env": "^7.16.4",
15
- "@socialgouv/dila-api-client": "^1.2.4",
16
- "@socialgouv/eslint-config-strict": "^0.35.0",
17
- "@types/jest": "^27.0.3",
18
- "@types/node": "^14.17.34",
19
- "babel-eslint": "^10.1.0",
20
- "dotenv": "^16.0.0",
21
- "eslint": "^7.32.0",
22
- "eslint-plugin-sort-requires": "^2.1.0",
23
- "esm": "^3.2.25",
24
- "husky": "^7.0.4",
25
- "jest": "^27.4.4",
26
- "npmlog": "^7.0.0",
27
- "p-pipe": "^3.1.0",
28
- "p-queue": "^6.6.2",
29
- "p-retry": "^4.6.1",
30
- "prettier": "^2.5.1",
31
- "prompt": "^1.2.0",
32
- "semantic-release": "^19.0.0",
33
- "typescript": "^5.1.6",
34
- "unist-util-filter": "^2.0.3",
35
- "unist-util-map": "^2.0.1"
36
- },
37
- "engines": {
38
- "node": ">= v14.18.2"
39
- },
40
- "files": [
41
- "data",
42
- "src"
43
- ],
44
- "homepage": "https://github.com/SocialGouv/kali-data",
45
- "license": "Apache-2.0",
46
- "main": "./src/index.js",
47
- "publishConfig": {
48
- "access": "public"
49
- },
50
- "repository": "https://github.com/SocialGouv/kali-data.git",
51
- "scripts": {
52
- "data:check": "node -r esm ./scripts/check.js",
53
- "data:fetch": "node -r dotenv/config -r esm ./scripts/fetch.js dotenv_config_path=./.env",
54
- "data:list": "node -r esm ./scripts/list.js",
55
- "data:match": "node -r esm ./scripts/match.js",
56
- "data:update": "yarn data:fetch && yarn data:match && yarn data:list && yarn data:check",
57
- "posttest": "yarn data:check",
58
- "setup": "node -r esm ./scripts/setup.js",
59
- "test": "yarn test:lint && yarn test:type && yarn test:unit --silent",
60
- "test:lint": "eslint .",
61
- "test:type": "tsc --noEmit",
62
- "test:unit": "jest",
63
- "test:update": "jest --updateSnapshot",
64
- "test:watch": "yarn test:unit --watch",
65
- "build": "tsc && rm -rf ./dist/update-cc/data-cc && cp -r ./update-cc/data-cc ./dist/update-cc/data-cc",
66
- "update-cc": "npm run build && node dist/update-cc/index.js"
67
- },
68
- "types": "./src/index.d.ts",
69
- "babel": {
70
- "env": {
71
- "test": {
72
- "plugins": [
73
- [
74
- "@babel/plugin-transform-modules-commonjs"
75
- ]
76
- ]
77
- }
2
+ "name": "@socialgouv/kali-data",
3
+ "version": "2.617.0",
4
+ "dependencies": {
5
+ "csv-parser": "^3.0.0",
6
+ "node-xlsx": "^0.23.0",
7
+ "unist-util-find": "1.0.4",
8
+ "unist-util-flat-filter": "1.0.0",
9
+ "unist-util-parents": "1.0.3"
10
+ },
11
+ "devDependencies": {
12
+ "@babel/core": "^7.16.0",
13
+ "@babel/plugin-transform-modules-commonjs": "^7.16.0",
14
+ "@babel/preset-env": "^7.16.4",
15
+ "@socialgouv/dila-api-client": "^1.2.4",
16
+ "@socialgouv/eslint-config-strict": "^0.35.0",
17
+ "@types/jest": "^27.0.3",
18
+ "@types/node": "^14.17.34",
19
+ "babel-eslint": "^10.1.0",
20
+ "dotenv": "^16.0.0",
21
+ "eslint": "^7.32.0",
22
+ "eslint-plugin-sort-requires": "^2.1.0",
23
+ "esm": "^3.2.25",
24
+ "husky": "^7.0.4",
25
+ "jest": "^27.4.4",
26
+ "npmlog": "^7.0.0",
27
+ "p-pipe": "^3.1.0",
28
+ "p-queue": "^6.6.2",
29
+ "p-retry": "^4.6.1",
30
+ "prettier": "^2.5.1",
31
+ "prompt": "^1.2.0",
32
+ "semantic-release": "^19.0.0",
33
+ "typescript": "^5.1.6",
34
+ "unist-util-filter": "^2.0.3",
35
+ "unist-util-map": "^2.0.1"
36
+ },
37
+ "engines": {
38
+ "node": ">= v14.18.2"
39
+ },
40
+ "files": [
41
+ "data",
42
+ "src"
43
+ ],
44
+ "homepage": "https://github.com/SocialGouv/kali-data",
45
+ "license": "Apache-2.0",
46
+ "main": "./src/index.js",
47
+ "publishConfig": {
48
+ "access": "public"
49
+ },
50
+ "repository": "https://github.com/SocialGouv/kali-data.git",
51
+ "scripts": {
52
+ "data:check": "node -r esm ./scripts/check.js",
53
+ "data:fetch": "node -r dotenv/config -r esm ./scripts/fetch.js dotenv_config_path=./.env",
54
+ "data:list": "node -r esm ./scripts/list.js",
55
+ "data:match": "node -r esm ./scripts/match.js",
56
+ "data:update": "yarn data:fetch && yarn data:match && yarn data:list && yarn data:check",
57
+ "posttest": "yarn data:check",
58
+ "setup": "node -r esm ./scripts/setup.js",
59
+ "test": "yarn test:lint && yarn test:type && yarn test:unit --silent",
60
+ "test:lint": "eslint .",
61
+ "lint:fix": "eslint --fix .",
62
+ "test:type": "tsc --noEmit",
63
+ "test:unit": "jest",
64
+ "test:update": "jest --updateSnapshot",
65
+ "test:watch": "yarn test:unit --watch",
66
+ "build": "tsc && rm -rf ./dist/update-cc/data-cc && cp -r ./update-cc/data-cc ./dist/update-cc/data-cc",
67
+ "update-cc": "npm run build && node dist/update-cc/index.js"
68
+ },
69
+ "types": "./src/index.d.ts",
70
+ "babel": {
71
+ "env": {
72
+ "test": {
73
+ "plugins": [
74
+ [
75
+ "@babel/plugin-transform-modules-commonjs"
76
+ ]
77
+ ]
78
+ }
79
+ }
78
80
  }
79
- }
80
81
  }
@@ -4,21 +4,21 @@ import path from "path";
4
4
  import kaliData from "../..";
5
5
 
6
6
  test(`@socialgouv/kali-data`, () => {
7
- const libNames = fs
8
- .readdirSync(path.join(__dirname, "../libs"))
9
- .filter(name => name !== "__tests__");
7
+ const libNames = fs
8
+ .readdirSync(path.join(__dirname, "../libs"))
9
+ .filter(name => name !== "__tests__");
10
10
 
11
- expect(Object.keys(kaliData)).toHaveLength(libNames.length);
11
+ expect(Object.keys(kaliData)).toHaveLength(libNames.length);
12
12
 
13
- expect(kaliData.getAgreement).toBeInstanceOf(Function);
14
- expect(kaliData.getAgreementArticlesWithParentSections).toBeInstanceOf(Function);
15
- expect(kaliData.getAgreementArticlesWithPath).toBeInstanceOf(Function);
16
- expect(kaliData.getAgreementIdFromIdOrIdcc).toBeInstanceOf(Function);
17
- expect(kaliData.getAgreements).toBeInstanceOf(Function);
18
- expect(kaliData.getArticleWithParentSections).toBeInstanceOf(Function);
19
- expect(kaliData.getArticleWithPath).toBeInstanceOf(Function);
20
- expect(kaliData.getArticles).toBeInstanceOf(Function);
21
- expect(kaliData.getIndexedArticle).toBeInstanceOf(Function);
22
- expect(kaliData.hasAgreement).toBeInstanceOf(Function);
23
- expect(kaliData.hasArticle).toBeInstanceOf(Function);
13
+ expect(kaliData.getAgreement).toBeInstanceOf(Function);
14
+ expect(kaliData.getAgreementArticlesWithParentSections).toBeInstanceOf(Function);
15
+ expect(kaliData.getAgreementArticlesWithPath).toBeInstanceOf(Function);
16
+ expect(kaliData.getAgreementIdFromIdOrIdcc).toBeInstanceOf(Function);
17
+ expect(kaliData.getAgreements).toBeInstanceOf(Function);
18
+ expect(kaliData.getArticleWithParentSections).toBeInstanceOf(Function);
19
+ expect(kaliData.getArticleWithPath).toBeInstanceOf(Function);
20
+ expect(kaliData.getArticles).toBeInstanceOf(Function);
21
+ expect(kaliData.getIndexedArticle).toBeInstanceOf(Function);
22
+ expect(kaliData.hasAgreement).toBeInstanceOf(Function);
23
+ expect(kaliData.hasArticle).toBeInstanceOf(Function);
24
24
  });
@@ -1,15 +1,15 @@
1
1
  import checkArticleIdOrCid from "../checkArticleIdOrCid";
2
2
 
3
3
  describe(`helpers/checkArticleIdOrCid()`, () => {
4
- describe(`should not throw`, () => {
5
- it(`with a valid article ID`, () => {
6
- expect(() => checkArticleIdOrCid("KALIARTI123456789012")).not.toThrow();
4
+ describe(`should not throw`, () => {
5
+ it(`with a valid article ID`, () => {
6
+ expect(() => checkArticleIdOrCid("KALIARTI123456789012")).not.toThrow();
7
+ });
7
8
  });
8
- });
9
9
 
10
- describe(`should throw`, () => {
11
- it(`with a malformed article ID`, () => {
12
- expect(() => checkArticleIdOrCid("MALFORMEDID")).toThrow();
10
+ describe(`should throw`, () => {
11
+ it(`with a malformed article ID`, () => {
12
+ expect(() => checkArticleIdOrCid("MALFORMEDID")).toThrow();
13
+ });
13
14
  });
14
- });
15
15
  });
@@ -1,23 +1,23 @@
1
1
  import isFile from "../isFile";
2
2
 
3
3
  describe(`helpers/isFile()`, () => {
4
- describe(`should return true`, () => {
5
- it(`with an existing file absolute path`, () => {
6
- expect(isFile(`${__dirname}/fixtures/aFile`)).toBe(true);
4
+ describe(`should return true`, () => {
5
+ it(`with an existing file absolute path`, () => {
6
+ expect(isFile(`${__dirname}/fixtures/aFile`)).toBe(true);
7
+ });
7
8
  });
8
- });
9
9
 
10
- describe(`should return false`, () => {
11
- it(`with an existing file relative path`, () => {
12
- expect(isFile("./fixtures/aFile")).toBe(false);
13
- });
10
+ describe(`should return false`, () => {
11
+ it(`with an existing file relative path`, () => {
12
+ expect(isFile("./fixtures/aFile")).toBe(false);
13
+ });
14
14
 
15
- it(`with an existing directory path`, () => {
16
- expect(isFile("./fixtures/aDirectory")).toBe(false);
17
- });
15
+ it(`with an existing directory path`, () => {
16
+ expect(isFile("./fixtures/aDirectory")).toBe(false);
17
+ });
18
18
 
19
- it(`with a non-existant file path`, () => {
20
- expect(isFile("./fixtures/aNonexistentFile")).toBe(false);
19
+ it(`with a non-existant file path`, () => {
20
+ expect(isFile("./fixtures/aNonexistentFile")).toBe(false);
21
+ });
21
22
  });
22
- });
23
23
  });
@@ -6,12 +6,12 @@
6
6
  * @returns {void}
7
7
  */
8
8
  function checkArticleIdOrCid(articleIdOrCid) {
9
- if (typeof articleIdOrCid !== "string" || !/^KALIARTI\d{12}$/.test(articleIdOrCid)) {
10
- throw new Error(
11
- `<articleIdOrCid> is malformed (${articleIdOrCid}). ` +
12
- `It must be a valid article ID or CID (string: "KALIARTI123456789012").`,
13
- );
14
- }
9
+ if (typeof articleIdOrCid !== "string" || !/^KALIARTI\d{12}$/.test(articleIdOrCid)) {
10
+ throw new Error(
11
+ `<articleIdOrCid> is malformed (${articleIdOrCid}). ` +
12
+ `It must be a valid article ID or CID (string: "KALIARTI123456789012").`,
13
+ );
14
+ }
15
15
  }
16
16
 
17
17
  module.exports = checkArticleIdOrCid;
@@ -8,7 +8,7 @@ const fs = require("fs");
8
8
  * @returns {boolean}
9
9
  */
10
10
  function isFile(absolutePath) {
11
- return fs.existsSync(absolutePath) && fs.lstatSync(absolutePath).isFile();
11
+ return fs.existsSync(absolutePath) && fs.lstatSync(absolutePath).isFile();
12
12
  }
13
13
 
14
14
  module.exports = isFile;
@@ -4,8 +4,8 @@
4
4
  * @returns {((indexedArticle: KaliData.IndexedArticle) => boolean)}
5
5
  */
6
6
  function withArticleIdOrCid(articleIdOrCid) {
7
- return indexedArticle =>
8
- indexedArticle.articleId === articleIdOrCid || indexedArticle.articleCid === articleIdOrCid;
7
+ return indexedArticle =>
8
+ indexedArticle.articleId === articleIdOrCid || indexedArticle.articleCid === articleIdOrCid;
9
9
  }
10
10
 
11
11
  module.exports = withArticleIdOrCid;
package/src/index.js CHANGED
@@ -13,15 +13,15 @@ const hasAgreement = require("./libs/hasAgreement");
13
13
  const hasArticle = require("./libs/hasArticle");
14
14
 
15
15
  module.exports = {
16
- getAgreement,
17
- getAgreementArticlesWithParentSections,
18
- getAgreementArticlesWithPath,
19
- getAgreementIdFromIdOrIdcc,
20
- getAgreements,
21
- getArticleWithParentSections,
22
- getArticleWithPath,
23
- getArticles,
24
- getIndexedArticle,
25
- hasAgreement,
26
- hasArticle,
16
+ getAgreement,
17
+ getAgreementArticlesWithParentSections,
18
+ getAgreementArticlesWithPath,
19
+ getAgreementIdFromIdOrIdcc,
20
+ getAgreements,
21
+ getArticleWithParentSections,
22
+ getArticleWithPath,
23
+ getArticles,
24
+ getIndexedArticle,
25
+ hasAgreement,
26
+ hasArticle,
27
27
  };
@@ -1,39 +1,39 @@
1
1
  import getAgreement from "../getAgreement";
2
2
 
3
3
  describe(`libs/getAgreement()`, () => {
4
- describe(`should match properties`, () => {
5
- it(`with an existing agreement ID`, () => {
6
- const received = getAgreement("KALICONT000005635444");
4
+ describe(`should match properties`, () => {
5
+ it(`with an existing agreement ID`, () => {
6
+ const received = getAgreement("KALICONT000005635444");
7
7
 
8
- expect(received.data.id).toBe("KALICONT000005635444");
9
- expect(received.data.num).toBe(1480);
10
- });
11
-
12
- it(`with an existing agreement IDCC (string)`, () => {
13
- const received = getAgreement("1480");
8
+ expect(received.data.id).toBe("KALICONT000005635444");
9
+ expect(received.data.num).toBe(1480);
10
+ });
14
11
 
15
- expect(received.data.id).toBe("KALICONT000005635444");
16
- expect(received.data.num).toBe(1480);
17
- });
12
+ it(`with an existing agreement IDCC (string)`, () => {
13
+ const received = getAgreement("1480");
18
14
 
19
- it(`with an existing agreement IDCC (number)`, () => {
20
- const received = getAgreement(1480);
15
+ expect(received.data.id).toBe("KALICONT000005635444");
16
+ expect(received.data.num).toBe(1480);
17
+ });
21
18
 
22
- expect(received.data.id).toBe("KALICONT000005635444");
23
- expect(received.data.num).toBe(1480);
24
- });
25
- });
26
- describe(`should throw`, () => {
27
- it(`with a nonexistent agreement ID`, () => {
28
- expect(() => getAgreement("KALICONT123456789012")).toThrow();
29
- });
19
+ it(`with an existing agreement IDCC (number)`, () => {
20
+ const received = getAgreement(1480);
30
21
 
31
- it(`with a nonexistent agreement IDCC (string)`, () => {
32
- expect(() => getAgreement("1234")).toThrow();
22
+ expect(received.data.id).toBe("KALICONT000005635444");
23
+ expect(received.data.num).toBe(1480);
24
+ });
33
25
  });
34
-
35
- it(`with a nonexistent agreement IDCC (number)`, () => {
36
- expect(() => getAgreement(1234)).toThrow();
26
+ describe(`should throw`, () => {
27
+ it(`with a nonexistent agreement ID`, () => {
28
+ expect(() => getAgreement("KALICONT123456789012")).toThrow();
29
+ });
30
+
31
+ it(`with a nonexistent agreement IDCC (string)`, () => {
32
+ expect(() => getAgreement("1234")).toThrow();
33
+ });
34
+
35
+ it(`with a nonexistent agreement IDCC (number)`, () => {
36
+ expect(() => getAgreement(1234)).toThrow();
37
+ });
37
38
  });
38
- });
39
39
  });
@@ -1,23 +1,23 @@
1
1
  import getAgreementArticlesWithParentSections from "../getAgreementArticlesWithParentSections";
2
2
 
3
3
  describe(`libs/getAgreementArticlesWithParentSections()`, () => {
4
- describe(`should match snapshot`, () => {
5
- it(`with an existing agreement ID`, () => {
6
- const received = getAgreementArticlesWithParentSections("KALICONT000005635221");
4
+ describe(`should match snapshot`, () => {
5
+ it(`with an existing agreement ID`, () => {
6
+ const received = getAgreementArticlesWithParentSections("KALICONT000005635221");
7
7
 
8
- expect(received[0].sections.length).toBeGreaterThan(1);
9
- });
8
+ expect(received[0].sections.length).toBeGreaterThan(1);
9
+ });
10
10
 
11
- it(`with an existing agreement IDCC (string)`, () => {
12
- const received = getAgreementArticlesWithParentSections("1480");
11
+ it(`with an existing agreement IDCC (string)`, () => {
12
+ const received = getAgreementArticlesWithParentSections("1480");
13
13
 
14
- expect(received[0].sections.length).toBeGreaterThan(1);
15
- });
14
+ expect(received[0].sections.length).toBeGreaterThan(1);
15
+ });
16
16
 
17
- it(`with an existing agreement IDCC (number)`, () => {
18
- const received = getAgreementArticlesWithParentSections(1480);
17
+ it(`with an existing agreement IDCC (number)`, () => {
18
+ const received = getAgreementArticlesWithParentSections(1480);
19
19
 
20
- expect(received[0].sections.length).toBeGreaterThan(1);
20
+ expect(received[0].sections.length).toBeGreaterThan(1);
21
+ });
21
22
  });
22
- });
23
23
  });
@@ -1,23 +1,23 @@
1
1
  import getAgreementArticlesWithPath from "../getAgreementArticlesWithPath";
2
2
 
3
3
  describe(`libs/getAgreementArticlesWithPath()`, () => {
4
- describe(`should match snapshot`, () => {
5
- it(`with an existing agreement ID`, () => {
6
- const received = getAgreementArticlesWithPath("KALICONT000005635221");
4
+ describe(`should match snapshot`, () => {
5
+ it(`with an existing agreement ID`, () => {
6
+ const received = getAgreementArticlesWithPath("KALICONT000005635221");
7
7
 
8
- expect(received[0].path.length).toBeGreaterThan(1);
9
- });
8
+ expect(received[0].path.length).toBeGreaterThan(1);
9
+ });
10
10
 
11
- it(`with an existing agreement IDCC (string)`, () => {
12
- const received = getAgreementArticlesWithPath("1480");
11
+ it(`with an existing agreement IDCC (string)`, () => {
12
+ const received = getAgreementArticlesWithPath("1480");
13
13
 
14
- expect(received[0].path.length).toBeGreaterThan(1);
15
- });
14
+ expect(received[0].path.length).toBeGreaterThan(1);
15
+ });
16
16
 
17
- it(`with an existing agreement IDCC (number)`, () => {
18
- const received = getAgreementArticlesWithPath(1480);
17
+ it(`with an existing agreement IDCC (number)`, () => {
18
+ const received = getAgreementArticlesWithPath(1480);
19
19
 
20
- expect(received[0].path.length).toBeGreaterThan(1);
20
+ expect(received[0].path.length).toBeGreaterThan(1);
21
+ });
21
22
  });
22
- });
23
23
  });
@@ -1,27 +1,27 @@
1
1
  import getAgreementIdFromIdOrIdcc from "../getAgreementIdFromIdOrIdcc";
2
2
 
3
3
  describe(`libs/getAgreementIdFromIdOrIdcc()`, () => {
4
- describe(`should return the expected ID`, () => {
5
- it(`with an existing agreement ID`, () => {
6
- expect(getAgreementIdFromIdOrIdcc("KALICONT000005635444")).toBe("KALICONT000005635444");
7
- });
4
+ describe(`should return the expected ID`, () => {
5
+ it(`with an existing agreement ID`, () => {
6
+ expect(getAgreementIdFromIdOrIdcc("KALICONT000005635444")).toBe("KALICONT000005635444");
7
+ });
8
8
 
9
- it(`with an existing agreement IDCC (string)`, () => {
10
- expect(getAgreementIdFromIdOrIdcc("1480")).toBe("KALICONT000005635444");
11
- });
9
+ it(`with an existing agreement IDCC (string)`, () => {
10
+ expect(getAgreementIdFromIdOrIdcc("1480")).toBe("KALICONT000005635444");
11
+ });
12
12
 
13
- it(`with an existing agreement IDCC (number)`, () => {
14
- expect(getAgreementIdFromIdOrIdcc(1480)).toBe("KALICONT000005635444");
13
+ it(`with an existing agreement IDCC (number)`, () => {
14
+ expect(getAgreementIdFromIdOrIdcc(1480)).toBe("KALICONT000005635444");
15
+ });
15
16
  });
16
- });
17
17
 
18
- describe(`should throw`, () => {
19
- it(`with a malformed input`, () => {
20
- expect(() => getAgreementIdFromIdOrIdcc("MALFORMEDID")).toThrow();
21
- });
18
+ describe(`should throw`, () => {
19
+ it(`with a malformed input`, () => {
20
+ expect(() => getAgreementIdFromIdOrIdcc("MALFORMEDID")).toThrow();
21
+ });
22
22
 
23
- it(`with a nonexistant agreement IDCC`, () => {
24
- expect(() => getAgreementIdFromIdOrIdcc("1234")).toThrow();
23
+ it(`with a nonexistant agreement IDCC`, () => {
24
+ expect(() => getAgreementIdFromIdOrIdcc("1234")).toThrow();
25
+ });
25
26
  });
26
- });
27
27
  });
@@ -1,7 +1,7 @@
1
1
  import getAgreements from "../getAgreements";
2
2
 
3
3
  describe(`libs/getAgreements()`, () => {
4
- it(`should return more than one agreement`, () => {
5
- expect(getAgreements().length).toBeGreaterThan(1);
6
- });
4
+ it(`should return more than one agreement`, () => {
5
+ expect(getAgreements().length).toBeGreaterThan(1);
6
+ });
7
7
  });
@@ -1,29 +1,29 @@
1
1
  import getArticleWithParentSections from "../getArticleWithParentSections";
2
2
 
3
3
  describe(`libs/getArticleWithParentSections()`, () => {
4
- describe(`should match properties`, () => {
5
- it(`with an existing main article ID`, () => {
6
- const received = getArticleWithParentSections("KALIARTI000005781804");
4
+ describe(`should match properties`, () => {
5
+ it(`with an existing main article ID`, () => {
6
+ const received = getArticleWithParentSections("KALIARTI000005781804");
7
7
 
8
- expect(received.data.cid).toBe("KALIARTI000005781804");
9
- expect(received.data.id).toBe("KALIARTI000045466361");
10
- expect(received.sections.length).toBeGreaterThan(1);
11
- });
8
+ expect(received.data.cid).toBe("KALIARTI000005781804");
9
+ expect(received.data.id).toBe("KALIARTI000045466361");
10
+ expect(received.sections.length).toBeGreaterThan(1);
11
+ });
12
12
 
13
- it(`with an existing main article CID`, () => {
14
- const received = getArticleWithParentSections("KALIARTI000005781804");
13
+ it(`with an existing main article CID`, () => {
14
+ const received = getArticleWithParentSections("KALIARTI000005781804");
15
15
 
16
- expect(received.data.cid).toBe("KALIARTI000005781804");
17
- expect(received.data.id).toBe("KALIARTI000045466361");
18
- expect(received.sections.length).toBeGreaterThan(1);
19
- });
16
+ expect(received.data.cid).toBe("KALIARTI000005781804");
17
+ expect(received.data.id).toBe("KALIARTI000045466361");
18
+ expect(received.sections.length).toBeGreaterThan(1);
19
+ });
20
20
 
21
- it(`with an existing additional article ID`, () => {
22
- const received = getArticleWithParentSections("KALIARTI000041787475");
21
+ it(`with an existing additional article ID`, () => {
22
+ const received = getArticleWithParentSections("KALIARTI000041787475");
23
23
 
24
- expect(received.data.cid).toBe("KALIARTI000041787475");
25
- expect(received.data.id).toBe("KALIARTI000041787475");
26
- expect(received.sections.length).toBeGreaterThan(1);
24
+ expect(received.data.cid).toBe("KALIARTI000041787475");
25
+ expect(received.data.id).toBe("KALIARTI000041787475");
26
+ expect(received.sections.length).toBeGreaterThan(1);
27
+ });
27
28
  });
28
- });
29
29
  });
@@ -1,29 +1,29 @@
1
1
  import getArticleWithPath from "../getArticleWithPath";
2
2
 
3
3
  describe(`libs/getArticleWithPath()`, () => {
4
- describe(`should match properties`, () => {
5
- it(`with an existing main article ID`, () => {
6
- const received = getArticleWithPath("KALIARTI000005781818");
4
+ describe(`should match properties`, () => {
5
+ it(`with an existing main article ID`, () => {
6
+ const received = getArticleWithPath("KALIARTI000005781818");
7
7
 
8
- expect(received.data.cid).toBe("KALIARTI000005781818");
9
- expect(received.data.id).toBe("KALIARTI000005781818");
10
- expect(received.path.length).toBeGreaterThan(1);
11
- });
8
+ expect(received.data.cid).toBe("KALIARTI000005781818");
9
+ expect(received.data.id).toBe("KALIARTI000005781818");
10
+ expect(received.path.length).toBeGreaterThan(1);
11
+ });
12
12
 
13
- it(`with an existing main article CID`, () => {
14
- const received = getArticleWithPath("KALIARTI000005781804");
13
+ it(`with an existing main article CID`, () => {
14
+ const received = getArticleWithPath("KALIARTI000005781804");
15
15
 
16
- expect(received.data.cid).toBe("KALIARTI000005781804");
17
- expect(received.data.id).toBe("KALIARTI000045466361");
18
- expect(received.path.length).toBeGreaterThan(1);
19
- });
16
+ expect(received.data.cid).toBe("KALIARTI000005781804");
17
+ expect(received.data.id).toBe("KALIARTI000045466361");
18
+ expect(received.path.length).toBeGreaterThan(1);
19
+ });
20
20
 
21
- it(`with an existing additional article ID`, () => {
22
- const received = getArticleWithPath("KALIARTI000041787475");
21
+ it(`with an existing additional article ID`, () => {
22
+ const received = getArticleWithPath("KALIARTI000041787475");
23
23
 
24
- expect(received.data.cid).toBe("KALIARTI000041787475");
25
- expect(received.data.id).toBe("KALIARTI000041787475");
26
- expect(received.path.length).toBeGreaterThan(1);
24
+ expect(received.data.cid).toBe("KALIARTI000041787475");
25
+ expect(received.data.id).toBe("KALIARTI000041787475");
26
+ expect(received.path.length).toBeGreaterThan(1);
27
+ });
27
28
  });
28
- });
29
29
  });