Test
{"ScriptPreparationCode":null,"TestCases":[{"Name":"sadsadsadsa","Code":"const CERTIFICATES_MAP = {\r\n hasTCC: \u0027tccElite\u0027,\r\n hasTCE: \u0027tceElite\u0027,\r\n hasTCF: \u0027tcfElite\u0027,\r\n hasTCS: \u0027tcsElite\u0027,\r\n};\r\n\r\nconst EMPTY_CERTIFICATES = {\r\n hasTCF: false,\r\n hasTCS: false,\r\n hasTCC: false,\r\n hasTCE: false,\r\n};\r\nconst data = [\r\n {\r\n \u0022id\u0022: 14444,\r\n \u0022name\u0022: \u0022iso28000\u0022,\r\n \u0022isActive\u0022: true,\r\n \u0022certificationDate\u0022: \u00222020-10-25T08:00:00.000Z\u0022,\r\n \u0022expirationDate\u0022: \u00222021-10-21T09:50:00.000Z\u0022\r\n },\r\n {\r\n \u0022id\u0022: 14446,\r\n \u0022name\u0022: \u0022tccElite\u0022,\r\n \u0022isActive\u0022: true,\r\n \u0022certificationDate\u0022: \u00222020-10-25T08:00:00.000Z\u0022,\r\n \u0022expirationDate\u0022: \u00222021-10-21T09:50:00.000Z\u0022\r\n },\r\n {\r\n \u0022id\u0022: 14448,\r\n \u0022name\u0022: \u0022tcsElite\u0022,\r\n \u0022isActive\u0022: true,\r\n \u0022certificationDate\u0022: \u00222020-10-25T08:00:00.000Z\u0022,\r\n \u0022expirationDate\u0022: \u00222021-10-21T09:50:00.000Z\u0022\r\n },\r\n {\r\n \u0022id\u0022: 16343,\r\n \u0022name\u0022: \u0022tcfElite\u0022,\r\n \u0022isActive\u0022: true,\r\n \u0022certificationDate\u0022: \u00222021-11-10T00:00:00.000Z\u0022,\r\n \u0022expirationDate\u0022: \u00222022-11-10T00:00:00.000Z\u0022\r\n },\r\n {\r\n \u0022id\u0022: 16344,\r\n \u0022name\u0022: \u0022auditedInsurance\u0022,\r\n \u0022isActive\u0022: true,\r\n \u0022certificationDate\u0022: \u00222021-11-10T00:00:00.000Z\u0022,\r\n \u0022expirationDate\u0022: \u00222022-11-10T00:00:00.000Z\u0022\r\n }\r\n];\r\nObject.entries(CERTIFICATES_MAP).reduce((certificates, [k, v]) =\u003E {\r\n const cert = data.find( ({ name }) =\u003E name === v);\r\n certificates[k] = cert \u0026\u0026 cert.isActive || false;\r\n return certificates;\r\n }, {});","IsDeferred":false},{"Name":"12312321321","Code":"const CERTIFICATES_MAP = {\r\n hasTCC: \u0027tccElite\u0027,\r\n hasTCE: \u0027tceElite\u0027,\r\n hasTCF: \u0027tcfElite\u0027,\r\n hasTCS: \u0027tcsElite\u0027,\r\n};\r\n\r\nconst EMPTY_CERTIFICATES = {\r\n hasTCF: false,\r\n hasTCS: false,\r\n hasTCC: false,\r\n hasTCE: false,\r\n};\r\nconst data = [\r\n {\r\n \u0022id\u0022: 14444,\r\n \u0022name\u0022: \u0022iso28000\u0022,\r\n \u0022isActive\u0022: true,\r\n \u0022certificationDate\u0022: \u00222020-10-25T08:00:00.000Z\u0022,\r\n \u0022expirationDate\u0022: \u00222021-10-21T09:50:00.000Z\u0022\r\n },\r\n {\r\n \u0022id\u0022: 14446,\r\n \u0022name\u0022: \u0022tccElite\u0022,\r\n \u0022isActive\u0022: true,\r\n \u0022certificationDate\u0022: \u00222020-10-25T08:00:00.000Z\u0022,\r\n \u0022expirationDate\u0022: \u00222021-10-21T09:50:00.000Z\u0022\r\n },\r\n {\r\n \u0022id\u0022: 14448,\r\n \u0022name\u0022: \u0022tcsElite\u0022,\r\n \u0022isActive\u0022: true,\r\n \u0022certificationDate\u0022: \u00222020-10-25T08:00:00.000Z\u0022,\r\n \u0022expirationDate\u0022: \u00222021-10-21T09:50:00.000Z\u0022\r\n },\r\n {\r\n \u0022id\u0022: 16343,\r\n \u0022name\u0022: \u0022tcfElite\u0022,\r\n \u0022isActive\u0022: true,\r\n \u0022certificationDate\u0022: \u00222021-11-10T00:00:00.000Z\u0022,\r\n \u0022expirationDate\u0022: \u00222022-11-10T00:00:00.000Z\u0022\r\n },\r\n {\r\n \u0022id\u0022: 16344,\r\n \u0022name\u0022: \u0022auditedInsurance\u0022,\r\n \u0022isActive\u0022: true,\r\n \u0022certificationDate\u0022: \u00222021-11-10T00:00:00.000Z\u0022,\r\n \u0022expirationDate\u0022: \u00222022-11-10T00:00:00.000Z\u0022\r\n }\r\n];\r\nObject.entries(CERTIFICATES_MAP).reduce((previousVal, currentKey) =\u003E {\r\n const certifications = { ...previousVal };\r\n certifications[currentKey] = !!data.find( ({ name }) =\u003E name === CERTIFICATES_MAP[currentKey]);\r\n return certifications;\r\n }, {});\r\n","IsDeferred":false}]}