Skip to content

Commit 32a0834

Browse files
committed
fix unit test on get modified piece
1 parent 33fe43b commit 32a0834

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

Documentation_website/docs/Tools/assets/unit-tests/1R_Unit_Tests.postman_collection

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"info": {
3-
"_postman_id": "9c1f43f2-3f22-44cf-955f-ec4836550faf",
3+
"_postman_id": "76acdc49-ac81-4ab6-9a62-eb9216960c54",
44
"name": "ONE Record API Unit Tests 2025-07",
55
"description": "# ONE Record Example Collection\n\nThis collection contains all the examples described in the ONE Record API specification website([https://iata-cargo.github.io/ONE-Record/](https://))\n\n# Collection Variables\n\nA set of variables has been designed to ease the use of this collections. In order to run any call, please create an Environment and add the following variable:\n\n- baseUrl : the url of the ONE Record server (i.e. [https://1r.example.com](https://1r.example.com))\n \n\n# Authentication\n\nIf ONE Record Server implements the authentication, you should add a bearer token for each API call. For more information check the Security section on [https://iata-cargo.github.io/ONE-Record/](https://iata-cargo.github.io/ONE-Record/)",
66
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
@@ -2498,10 +2498,19 @@
24982498
" pm.test(\"Response contains coload\", () => {\r",
24992499
" pm.expect(jsonData).to.have.property(coload);\r",
25002500
" });\r",
2501-
" pm.test(\"Response value coload \", () => {\r",
2502-
" pm.expect(jsonData[coload]['@type']).to.eql('http://www.w3.org/2001/XMLSchema#boolean');\r",
2503-
" pm.expect(jsonData[coload]['@value']).to.false;\r",
2504-
" }); \r",
2501+
" \r",
2502+
" if (jsonData[coload] instanceof Object){\r",
2503+
" pm.test(\"Response value coload \", () => {\r",
2504+
" pm.expect(jsonData[coload]['@type']).to.eql('http://www.w3.org/2001/XMLSchema#boolean');\r",
2505+
" pm.expect(jsonData[coload]['@value'].toString()).to.eql('false')\r",
2506+
" });\r",
2507+
" } else {\r",
2508+
" pm.test(\"Response value coload \", () => {\r",
2509+
" pm.expect(jsonData[coload]).to.eql(false);\r",
2510+
" pm.expect(jsonData[coload]).to.be.a('boolean'); \r",
2511+
" });\r",
2512+
" }\r",
2513+
"\r",
25052514
" let specialHandlingCodes = \"https://onerecord.iata.org/ns/cargo#specialHandlingCodes\";\r",
25062515
" pm.test(\"Response contains specialHandlingCodes \", () => {\r",
25072516
" pm.expect(jsonData).to.have.property(specialHandlingCodes);\r",
@@ -6182,7 +6191,7 @@
61826191
{
61836192
"listen": "prerequest",
61846193
"script": {
6185-
"type": "text/javascript",
6194+
"type": "text/javascript",
61866195
"exec": [
61876196
""
61886197
]
@@ -6324,4 +6333,4 @@
63246333
"value": ""
63256334
}
63266335
]
6327-
}
6336+
}

0 commit comments

Comments
 (0)