@socialgouv/kali-data 2.615.0 → 2.616.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 (33) hide show
  1. package/data/KALICONT000005635472.json +0 -1
  2. package/data/KALICONT000005635905.json +0 -1
  3. package/data/index.json +14 -42
  4. package/package.json +78 -77
  5. package/src/__tests__/index.test.js +15 -15
  6. package/src/helpers/__tests__/checkArticleIdOrCid.test.js +8 -8
  7. package/src/helpers/__tests__/isFile.test.js +14 -14
  8. package/src/helpers/checkArticleIdOrCid.js +6 -6
  9. package/src/helpers/isFile.js +1 -1
  10. package/src/helpers/withArticleIdOrCid.js +2 -2
  11. package/src/index.js +11 -11
  12. package/src/libs/__tests__/getAgreement.test.js +28 -28
  13. package/src/libs/__tests__/getAgreementArticlesWithParentSections.test.js +13 -13
  14. package/src/libs/__tests__/getAgreementArticlesWithPath.test.js +13 -13
  15. package/src/libs/__tests__/getAgreementIdFromIdOrIdcc.test.js +17 -17
  16. package/src/libs/__tests__/getAgreements.test.js +3 -3
  17. package/src/libs/__tests__/getArticleWithParentSections.test.js +19 -19
  18. package/src/libs/__tests__/getArticleWithPath.test.js +19 -19
  19. package/src/libs/__tests__/getArticles.test.js +3 -3
  20. package/src/libs/__tests__/getIndexedArticle.test.js +19 -19
  21. package/src/libs/__tests__/hasAgreement.test.js +23 -23
  22. package/src/libs/__tests__/hasArticle.test.js +14 -14
  23. package/src/libs/getAgreement.js +7 -7
  24. package/src/libs/getAgreementArticlesWithParentSections.js +22 -22
  25. package/src/libs/getAgreementArticlesWithPath.js +11 -11
  26. package/src/libs/getAgreementIdFromIdOrIdcc.js +18 -18
  27. package/src/libs/getAgreements.js +3 -3
  28. package/src/libs/getArticleWithParentSections.js +34 -34
  29. package/src/libs/getArticleWithPath.js +25 -25
  30. package/src/libs/getArticles.js +3 -3
  31. package/src/libs/getIndexedArticle.js +6 -6
  32. package/src/libs/hasAgreement.js +10 -9
  33. package/src/libs/hasArticle.js +6 -6
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "type": "convention collective",
3
3
  "data": {
4
- "num": null,
5
4
  "title": "Accord du 3 mars 1993 relatif aux cadres de direction",
6
5
  "id": "KALICONT000005635472",
7
6
  "shortTitle": "Sociétés d'assurances",
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "type": "convention collective",
3
3
  "data": {
4
- "num": null,
5
4
  "title": "Accord national du 23 janvier 1986 relatif aux salariés permanents des entreprises de travail temporaire. En vigueur le 1er juillet 1986. ",
6
5
  "id": "KALICONT000005635905",
7
6
  "shortTitle": "Travail temporaire : personnels intérimaires et permanents",
package/data/index.json CHANGED
@@ -39,10 +39,7 @@
39
39
  "texte_de_base": "KALITEXT000005647125",
40
40
  "title": "Nouvelle convention collective nationale des ouvriers employés par les entreprises du bâtiment visées par le décret du 1er mars 1962 (c'est-à-dire occupant jusqu'à 10 salariés) du 7 mars 2018 (Avenant du 7 mars 2018) ",
41
41
  "url": "https://www.legifrance.gouv.fr/affichIDCC.do?idConvention=KALICONT000005635221",
42
- "synonymes": [
43
- "1596",
44
- "1740"
45
- ]
42
+ "synonymes": ["1596", "1740"]
46
43
  },
47
44
  {
48
45
  "active": true,
@@ -57,10 +54,7 @@
57
54
  "texte_de_base": "KALITEXT000005645150",
58
55
  "title": "Nouvelle convention collective nationale des ouvriers employés par les entreprises du bâtiment non visées par le décret du 1er mars 1962 (c'est-à-dire occupant plus de 10 salariés) du 7 mars 2018 (Avenant du 7 mars 2018)",
59
56
  "url": "https://www.legifrance.gouv.fr/affichIDCC.do?idConvention=KALICONT000005635220",
60
- "synonymes": [
61
- "1597",
62
- "1740"
63
- ]
57
+ "synonymes": ["1597", "1740"]
64
58
  },
65
59
  {
66
60
  "active": true,
@@ -381,9 +375,7 @@
381
375
  "texte_de_base": "KALITEXT000026943196",
382
376
  "title": "Convention collective nationale des entreprises de services à la personne du 20 septembre 2012",
383
377
  "url": "https://www.legifrance.gouv.fr/affichIDCC.do?idConvention=KALICONT000027084096",
384
- "synonymes": [
385
- "SAP"
386
- ]
378
+ "synonymes": ["SAP"]
387
379
  },
388
380
  {
389
381
  "active": true,
@@ -1297,9 +1289,7 @@
1297
1289
  "texte_de_base": "KALITEXT000018926214",
1298
1290
  "title": "Convention collective nationale des employés, techniciens et agents de maîtrise des travaux publics du 12 juillet 2006",
1299
1291
  "url": "https://www.legifrance.gouv.fr/affichIDCC.do?idConvention=KALICONT000018926209",
1300
- "synonymes": [
1301
- "TP"
1302
- ]
1292
+ "synonymes": ["TP"]
1303
1293
  },
1304
1294
  {
1305
1295
  "active": true,
@@ -2105,9 +2095,7 @@
2105
2095
  "texte_de_base": "KALITEXT000005670044",
2106
2096
  "title": "Convention collective nationale des hôtels, cafés restaurants (HCR) du 30 avril 1997",
2107
2097
  "url": "https://www.legifrance.gouv.fr/affichIDCC.do?idConvention=KALICONT000005635534",
2108
- "synonymes": [
2109
- "HCR"
2110
- ]
2098
+ "synonymes": ["HCR"]
2111
2099
  },
2112
2100
  {
2113
2101
  "active": true,
@@ -2458,9 +2446,7 @@
2458
2446
  "texte_de_base": "KALITEXT000005658951",
2459
2447
  "title": "Convention collective nationale des ouvriers des travaux publics du 15 décembre 1992",
2460
2448
  "url": "https://www.legifrance.gouv.fr/affichIDCC.do?idConvention=KALICONT000005635467",
2461
- "synonymes": [
2462
- "TP"
2463
- ]
2449
+ "synonymes": ["TP"]
2464
2450
  },
2465
2451
  {
2466
2452
  "active": true,
@@ -2922,10 +2908,7 @@
2922
2908
  "texte_de_base": "KALITEXT000005679895",
2923
2909
  "title": "Convention collective nationale des bureaux d'études techniques, des cabinets d'ingénieurs-conseils et des sociétés de conseils du 15 décembre 1987. ",
2924
2910
  "url": "https://www.legifrance.gouv.fr/affichIDCC.do?idConvention=KALICONT000005635173",
2925
- "synonymes": [
2926
- "syntec",
2927
- "cinov"
2928
- ]
2911
+ "synonymes": ["syntec", "cinov"]
2929
2912
  },
2930
2913
  {
2931
2914
  "active": true,
@@ -3510,10 +3493,7 @@
3510
3493
  "texte_de_base": "KALITEXT000022192697",
3511
3494
  "title": "Convention collective nationale de travail des etablissements et services pour personnes inadaptées et handicapées du 15 mars 1966. Mise à jour au 15 septembre 1976.",
3512
3495
  "url": "https://www.legifrance.gouv.fr/affichIDCC.do?idConvention=KALICONT000005635407",
3513
- "synonymes": [
3514
- "1966",
3515
- "66"
3516
- ]
3496
+ "synonymes": ["1966", "66"]
3517
3497
  },
3518
3498
  {
3519
3499
  "active": true,
@@ -4166,11 +4146,7 @@
4166
4146
  "texte_de_base": "KALITEXT000029787837",
4167
4147
  "title": "Convention collective nationale des etablissements privés d'hospitalisation, de soins, de cure et de garde à but non lucratif du 31 octobre 1951.",
4168
4148
  "url": "https://www.legifrance.gouv.fr/affichIDCC.do?idConvention=KALICONT000005635234",
4169
- "synonymes": [
4170
- "FEHAP",
4171
- "1951",
4172
- "51"
4173
- ]
4149
+ "synonymes": ["FEHAP", "1951", "51"]
4174
4150
  },
4175
4151
  {
4176
4152
  "active": true,
@@ -4491,9 +4467,7 @@
4491
4467
  "num": 3231,
4492
4468
  "shortTitle": "Convention collective territoriale de la métallurgie du Jura",
4493
4469
  "title": "Convention collective territoriale de la métallurgie du Jura",
4494
- "synonymes": [
4495
- "1809"
4496
- ]
4470
+ "synonymes": ["1809"]
4497
4471
  },
4498
4472
  {
4499
4473
  "active": true,
@@ -4654,9 +4628,7 @@
4654
4628
  "num": 3209,
4655
4629
  "shortTitle": "Convention collective Métallurgie Doubs",
4656
4630
  "title": "Convention collective des industries mécaniques, microtechniques et connexes du département du Doubs",
4657
- "synonymes": [
4658
- "1375"
4659
- ]
4631
+ "synonymes": ["1375"]
4660
4632
  },
4661
4633
  {
4662
4634
  "active": true,
@@ -4920,9 +4892,9 @@
4920
4892
  "id": "KALICONT000005635472",
4921
4893
  "nature": "TI",
4922
4894
  "num": 2357,
4923
- "shortTitle": "Sociétés d'assurances",
4895
+ "shortTitle": "Accord professionnel relatif aux cadres de direction des sociétés d'assurances",
4924
4896
  "texte_de_base": "KALITEXT000005654777",
4925
- "title": "Accord du 3 mars 1993 relatif aux cadres de direction",
4897
+ "title": "Accord professionnel relatif aux cadres de direction des sociétés d'assurances",
4926
4898
  "url": "https://www.legifrance.gouv.fr/affichIDCC.do?idConvention=KALICONT000005635472"
4927
4899
  },
4928
4900
  {
@@ -4969,4 +4941,4 @@
4969
4941
  "title": "Convention collective nationale des entreprises de travaux et services agricoles, ruraux et forestiers (ETARF) du 8 octobre 2020",
4970
4942
  "url": "https://www.legifrance.gouv.fr/affichIDCC.do?idConvention=KALICONT000043169441"
4971
4943
  }
4972
- ]
4944
+ ]
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.616.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
  });