From f97a6021571576928872527e1cc00f282fd4b6db Mon Sep 17 00:00:00 2001 From: Penelope Lischer <102491809+penny-lischer@users.noreply.github.com> Date: Fri, 20 Sep 2024 10:27:23 -0700 Subject: [PATCH 1/3] 15839 - E2e tests (mock data) for all of Org/Receiver/Sender Settings Pages (#15921) * 15839 - E2e tests (mock data) for all of Org/Receiver/Sender Settings Pages Fixed last Mile Failures e2e broken test * 15839 - added data-test-id for e2e testing * 15839 - fixed indentation * 15839 - added optional heading param to BasePage.ts --- frontend-react/e2e/mocks/organizations.ts | 1359 ++++++++++++----- frontend-react/e2e/pages/BasePage.ts | 10 +- .../{ => admin}/last-mile-failures.ts | 6 +- .../{ => admin}/message-details.ts | 4 +- .../{ => admin}/message-id-search.ts | 4 +- .../authenticated/admin/organization-edit.ts | 182 +++ .../authenticated/{ => admin}/organization.ts | 6 +- .../admin/last-mile-failures-page.spec.ts | 2 +- .../admin/message-details-page.spec.ts | 4 +- .../admin/message-id-search-page.spec.ts | 2 +- .../organization-settings-edit-page.spec.ts | 241 +++ .../admin/organization-settings-page.spec.ts | 54 +- .../e2e/spec/all/idletimeout.spec.ts | 2 +- .../last-mile-failures-page-user-flow.spec.ts | 6 +- ...ganization-settings-page-user-flow.spec.ts | 2 +- .../src/components/Admin/CompareJsonModal.tsx | 1 + 16 files changed, 1456 insertions(+), 429 deletions(-) rename frontend-react/e2e/pages/authenticated/{ => admin}/last-mile-failures.ts (94%) rename frontend-react/e2e/pages/authenticated/{ => admin}/message-details.ts (92%) rename frontend-react/e2e/pages/authenticated/{ => admin}/message-id-search.ts (93%) create mode 100644 frontend-react/e2e/pages/authenticated/admin/organization-edit.ts rename frontend-react/e2e/pages/authenticated/{ => admin}/organization.ts (90%) create mode 100644 frontend-react/e2e/spec/all/authenticated/admin/organization-settings-edit-page.spec.ts diff --git a/frontend-react/e2e/mocks/organizations.ts b/frontend-react/e2e/mocks/organizations.ts index ccf6449548f..185a0ed1dd0 100644 --- a/frontend-react/e2e/mocks/organizations.ts +++ b/frontend-react/e2e/mocks/organizations.ts @@ -1,387 +1,986 @@ -export const MOCK_GET_RECEIVERS_AK = [ - { - name: "full-elr-test", - organizationName: "ak-phd", - topic: "full-elr", - customerStatus: "active", - translation: { - schemaName: - "classpath:/metadata/hl7_mapping/receivers/STLTs/AK/AK-receiver-transform.yml", - useTestProcessingMode: false, - useBatchHeaders: true, - receivingApplicationName: null, - receivingApplicationOID: null, - receivingFacilityName: null, - receivingFacilityOID: null, - messageProfileId: null, - replaceValue: { - "PID-22-3": "CDCREC", - }, - replaceValueAwithB: {}, - reportingFacilityName: null, - reportingFacilityId: null, - reportingFacilityIdType: null, - suppressQstForAoe: false, - suppressHl7Fields: "PID-5-7, ORC-12-1, OBR-16-1", - suppressAoe: false, - defaultAoeToUnknown: false, - replaceUnicodeWithAscii: false, - useBlankInsteadOfUnknown: null, - truncateHDNamespaceIds: false, - truncateHl7Fields: null, - usePid14ForPatientEmail: false, - convertTimestampToDateTime: null, - cliaForOutOfStateTesting: null, - cliaForSender: {}, - phoneNumberFormatting: "STANDARD", - suppressNonNPI: false, - processingModeCode: null, - replaceDiiWithOid: null, - applyOTCDefault: false, - useOrderingFacilityName: "STANDARD", - valueSetOverrides: {}, - nameFormat: "STANDARD", - receivingOrganization: null, - convertPositiveDateTimeOffsetToNegative: false, - stripInvalidCharsRegex: null, - convertDateTimesToReceiverLocalTime: false, - useHighPrecisionHeaderDateTimeFormat: false, - type: "HL7", - truncationConfig: { - truncateHDNamespaceIds: false, - truncateHl7Fields: [], - customLengthHl7Fields: {}, - }, - }, - jurisdictionalFilter: [ - "(Bundle.entry.resource.ofType(ServiceRequest)[0].requester.resolve().organization.resolve().address.state.exists() and Bundle.entry.resource.ofType(ServiceRequest)[0].requester.resolve().organization.resolve().address.state = 'AK') or (Bundle.entry.resource.ofType(Patient).address.state.exists() and Bundle.entry.resource.ofType(Patient).address.state = 'AK')", - ], - qualityFilter: [ - "Bundle.entry.resource.ofType(MessageHeader).id.exists()", - "Bundle.entry.resource.ofType(Patient).birthDate.exists()", - "Bundle.entry.resource.ofType(Patient).name.family.exists()", - "Bundle.entry.resource.ofType(Patient).name.given.count() > 0", - "Bundle.entry.resource.ofType(Specimen).type.exists()", - "(Bundle.entry.resource.ofType(Patient).address.line.exists() or Bundle.entry.resource.ofType(Patient).address.postalCode.exists() or Bundle.entry.resource.ofType(Patient).telecom.exists())", - "((Bundle.entry.resource.ofType(Specimen).collection.collectedPeriod.exists() or Bundle.entry.resource.ofType(Specimen).collection.collected.exists()) or Bundle.entry.resource.ofType(ServiceRequest).occurrence.exists() or Bundle.entry.resource.ofType(Observation).effective.exists())", - ], - routingFilter: [ - "Bundle.entry.resource.ofType(Organization).where(identifier.value in ('05D2201580')).exists()", - ], - processingModeFilter: [ - "Bundle.entry.resource.ofType(MessageHeader).extension('https://reportstream.cdc.gov/fhir/StructureDefinition/sender-id').exists().not() or Bundle.entry.resource.ofType(MessageHeader).extension('https://reportstream.cdc.gov/fhir/StructureDefinition/sender-id').value != 'hcintegrations'", - ], - reverseTheQualityFilter: false, - deidentify: false, - deidentifiedValue: "", - timing: { - operation: "MERGE", - numberPerDay: 1440, - initialTime: "00:00", - timeZone: "EASTERN", - maxReportCount: 100, - whenEmpty: { - action: "NONE", - onlyOncePerDay: false, - }, - }, - description: "", - transport: { - host: "sftp-west.inductivehealth.com", - port: "22", - filePath: "/incoming/full_elr/staging", - credentialName: null, - type: "SFTP", - }, - version: 8, - createdBy: "michael.kalish@focusconsulting.io", - createdAt: "2024-03-05T16:03:09.781Z", - conditionFilter: [], - mappedConditionFilter: [], - externalName: null, - enrichmentSchemaNames: [], - timeZone: null, - dateTimeFormat: "OFFSET", +export const MOCK_GET_RECEIVERS_IGNORE = [ { + "name" : "QUALITY_ALL", + "organizationName" : "ignore", + "topic" : "covid-19", + "customerStatus" : "active", + "translation" : { + "schemaName" : "empty", + "format" : "CSV", + "useBatching" : false, + "defaults" : { }, + "nameFormat" : "STANDARD", + "receivingOrganization" : null, + "type" : "CUSTOM" }, - { - name: "elr", - organizationName: "ak-phd", - topic: "covid-19", - customerStatus: "active", - translation: { - schemaName: "covid-19", - useTestProcessingMode: false, - useBatchHeaders: true, - receivingApplicationName: null, - receivingApplicationOID: null, - receivingFacilityName: null, - receivingFacilityOID: null, - messageProfileId: null, - replaceValue: { - "PID-22-3": "CDCREC", - }, - replaceValueAwithB: {}, - reportingFacilityName: null, - reportingFacilityId: null, - reportingFacilityIdType: null, - suppressQstForAoe: false, - suppressHl7Fields: "PID-5-7, ORC-12-1, OBR-16-1", - suppressAoe: false, - defaultAoeToUnknown: false, - replaceUnicodeWithAscii: false, - useBlankInsteadOfUnknown: null, - truncateHDNamespaceIds: false, - truncateHl7Fields: null, - usePid14ForPatientEmail: false, - convertTimestampToDateTime: null, - cliaForOutOfStateTesting: null, - cliaForSender: {}, - phoneNumberFormatting: "STANDARD", - suppressNonNPI: false, - processingModeCode: null, - replaceDiiWithOid: null, - applyOTCDefault: false, - useOrderingFacilityName: "STANDARD", - valueSetOverrides: {}, - nameFormat: "STANDARD", - receivingOrganization: null, - convertPositiveDateTimeOffsetToNegative: false, - stripInvalidCharsRegex: null, - convertDateTimesToReceiverLocalTime: false, - useHighPrecisionHeaderDateTimeFormat: false, - type: "HL7", - truncationConfig: { - truncateHDNamespaceIds: false, - truncateHl7Fields: [], - customLengthHl7Fields: {}, - }, - }, - jurisdictionalFilter: [ - "orEquals(ordering_facility_state, AK, patient_state, AK)", - ], - qualityFilter: ["doesNotMatch(sender_id, simple_report.*)"], - routingFilter: [], - processingModeFilter: ["matches(processing_mode_code,T,D,P)"], - reverseTheQualityFilter: false, - deidentify: false, - deidentifiedValue: "", - timing: { - operation: "MERGE", - numberPerDay: 1440, - initialTime: "00:00", - timeZone: "EASTERN", - maxReportCount: 100, - whenEmpty: { - action: "NONE", - onlyOncePerDay: false, - }, - }, - description: "", - transport: null, - version: 16, - createdBy: "james.gilmore@agile6.com", - createdAt: "2024-04-11T21:39:30.454Z", - conditionFilter: [], - mappedConditionFilter: [], - externalName: null, - enrichmentSchemaNames: [], - timeZone: null, - dateTimeFormat: "OFFSET", + "jurisdictionalFilter" : [ "matches(ordering_facility_state, IG)", "matches(ordering_facility_county, QUALITY_ALL)" ], + "qualityFilter" : [ "allowAll()" ], + "routingFilter" : [ ], + "processingModeFilter" : [ ], + "reverseTheQualityFilter" : false, + "deidentify" : false, + "deidentifiedValue" : "", + "timing" : null, + "description" : "", + "transport" : null, + "version" : null, + "createdBy" : null, + "createdAt" : null, + "conditionFilter" : [ ], + "mappedConditionFilter" : [ ], + "externalName" : null, + "enrichmentSchemaNames" : [ ], + "timeZone" : null, + "dateTimeFormat" : "OFFSET" +}, { + "name" : "QUALITY_FAIL", + "organizationName" : "ignore", + "topic" : "covid-19", + "customerStatus" : "active", + "translation" : { + "schemaName" : "empty", + "format" : "CSV", + "useBatching" : false, + "defaults" : { }, + "nameFormat" : "STANDARD", + "receivingOrganization" : null, + "type" : "CUSTOM" }, -]; - -export const MOCK_GET_RECEIVERS_IGNORE = [ - { - name: "FULL_ELR", - organizationName: "ignore", - topic: "full-elr", - customerStatus: "active", - translation: { - schemaName: - "classpath:/metadata/hl7_mapping/receivers/STLTs/CO/CO.yml", - useTestProcessingMode: false, - useBatchHeaders: true, - receivingApplicationName: "CA-ELR", - receivingApplicationOID: null, - receivingFacilityName: "CA", - receivingFacilityOID: null, - messageProfileId: null, - replaceValue: {}, - replaceValueAwithB: {}, - reportingFacilityName: null, - reportingFacilityId: null, - reportingFacilityIdType: null, - suppressQstForAoe: false, - suppressHl7Fields: null, - suppressAoe: false, - defaultAoeToUnknown: false, - replaceUnicodeWithAscii: false, - useBlankInsteadOfUnknown: null, - truncateHDNamespaceIds: false, - truncateHl7Fields: null, - usePid14ForPatientEmail: false, - convertTimestampToDateTime: null, - cliaForOutOfStateTesting: null, - cliaForSender: {}, - phoneNumberFormatting: "STANDARD", - suppressNonNPI: false, - processingModeCode: null, - replaceDiiWithOid: null, - applyOTCDefault: false, - useOrderingFacilityName: "STANDARD", - valueSetOverrides: {}, - nameFormat: "standard", - receivingOrganization: null, - convertPositiveDateTimeOffsetToNegative: false, - stripInvalidCharsRegex: null, - convertDateTimesToReceiverLocalTime: false, - useHighPrecisionHeaderDateTimeFormat: false, - type: "HL7", - truncationConfig: { - truncateHDNamespaceIds: false, - truncateHl7Fields: [], - customLengthHl7Fields: {}, - }, - }, - jurisdictionalFilter: [ - "(Bundle.entry.resource.ofType(ServiceRequest)[0].requester.resolve().organization.resolve().address.state.exists() and Bundle.entry.resource.ofType(ServiceRequest)[0].requester.resolve().organization.resolve().address.state = 'IG') or (Bundle.entry.resource.ofType(Patient).address.state.exists() and Bundle.entry.resource.ofType(Patient).address.state = 'IG')", - ], - qualityFilter: [ - "Bundle.entry.resource.ofType(MessageHeader).id.exists()", - "Bundle.entry.resource.ofType(Patient).birthDate.exists()", - "Bundle.entry.resource.ofType(Patient).name.family.exists()", - "Bundle.entry.resource.ofType(Patient).name.given.count() > 0", - "Bundle.entry.resource.ofType(Specimen).type.exists()", - "(Bundle.entry.resource.ofType(Patient).address.line.exists() or Bundle.entry.resource.ofType(Patient).address.postalCode.exists() or Bundle.entry.resource.ofType(Patient).telecom.exists())", - "((Bundle.entry.resource.ofType(Specimen).collection.collectedPeriod.exists() or Bundle.entry.resource.ofType(Specimen).collection.collected.exists()) or Bundle.entry.resource.ofType(ServiceRequest).occurrence.exists() or Bundle.entry.resource.ofType(Observation).effective.exists())", - ], - routingFilter: [], - processingModeFilter: [ - "Bundle.entry.resource.ofType(MessageHeader).extension('https://reportstream.cdc.gov/fhir/StructureDefinition/sender-id').exists().not() or Bundle.entry.resource.ofType(MessageHeader).extension('https://reportstream.cdc.gov/fhir/StructureDefinition/sender-id').value != 'hcintegrations'", - ], - reverseTheQualityFilter: false, - deidentify: false, - deidentifiedValue: "", - timing: { - operation: "MERGE", - numberPerDay: 1440, - initialTime: "00:00", - timeZone: "EASTERN", - maxReportCount: 100, - whenEmpty: { - action: "NONE", - onlyOncePerDay: false, - }, - }, - description: "", - transport: { - host: "172.17.6.20", - port: "22", - filePath: "./upload", - credentialName: null, - type: "SFTP", - }, - version: 13, - createdBy: "michael.kalish@focusconsulting.io", - createdAt: "2024-02-27T21:52:41.537Z", - conditionFilter: [], - mappedConditionFilter: [], - externalName: "Ignore FULL_ELR", - enrichmentSchemaNames: [], - timeZone: null, - dateTimeFormat: "OFFSET", + "jurisdictionalFilter" : [ "matches(ordering_facility_state, IG)", "matches(ordering_facility_county, QUALITY_FAIL)" ], + "qualityFilter" : [ "hasValidDataFor(blankField)", "hasAtLeastOneOf(message_id,blankField)" ], + "routingFilter" : [ ], + "processingModeFilter" : [ ], + "reverseTheQualityFilter" : false, + "deidentify" : false, + "deidentifiedValue" : "", + "timing" : null, + "description" : "", + "transport" : null, + "version" : null, + "createdBy" : null, + "createdAt" : null, + "conditionFilter" : [ ], + "mappedConditionFilter" : [ ], + "externalName" : null, + "enrichmentSchemaNames" : [ ], + "timeZone" : null, + "dateTimeFormat" : "OFFSET" +}, { + "name" : "HL7", + "organizationName" : "ignore", + "topic" : "covid-19", + "customerStatus" : "active", + "translation" : { + "schemaName" : "fl/fl-covid-19", + "format" : "HL7", + "useBatching" : false, + "defaults" : { }, + "nameFormat" : "STANDARD", + "receivingOrganization" : null, + "type" : "CUSTOM" }, - { - name: "ELR_ELIMS", - organizationName: "ignore", - topic: "elr-elims", - customerStatus: "active", - translation: { - schemaName: - "classpath:/metadata/hl7_mapping/ORU_R01/ORU_R01-base.yml", - useTestProcessingMode: false, - useBatchHeaders: true, - receivingApplicationName: null, - receivingApplicationOID: null, - receivingFacilityName: null, - receivingFacilityOID: null, - messageProfileId: null, - replaceValue: {}, - replaceValueAwithB: {}, - reportingFacilityName: null, - reportingFacilityId: null, - reportingFacilityIdType: null, - suppressQstForAoe: false, - suppressHl7Fields: null, - suppressAoe: false, - defaultAoeToUnknown: false, - replaceUnicodeWithAscii: false, - useBlankInsteadOfUnknown: null, - truncateHDNamespaceIds: false, - truncateHl7Fields: null, - usePid14ForPatientEmail: false, - convertTimestampToDateTime: null, - cliaForOutOfStateTesting: null, - cliaForSender: {}, - phoneNumberFormatting: "STANDARD", - suppressNonNPI: false, - processingModeCode: null, - replaceDiiWithOid: null, - applyOTCDefault: false, - useOrderingFacilityName: "STANDARD", - valueSetOverrides: {}, - nameFormat: "standard", - receivingOrganization: null, - convertPositiveDateTimeOffsetToNegative: false, - stripInvalidCharsRegex: null, - convertDateTimesToReceiverLocalTime: false, - useHighPrecisionHeaderDateTimeFormat: false, - type: "HL7", - truncationConfig: { - truncateHDNamespaceIds: false, - truncateHl7Fields: [], - customLengthHl7Fields: {}, - }, - }, - jurisdictionalFilter: [ - "(Bundle.entry.resource.ofType(ServiceRequest)[0].requester.resolve().organization.resolve().address.state.exists() and Bundle.entry.resource.ofType(ServiceRequest)[0].requester.resolve().organization.resolve().address.state = 'IG') or (Bundle.entry.resource.ofType(Patient).address.state.exists() and Bundle.entry.resource.ofType(Patient).address.state = 'IG')", - ], - qualityFilter: ["true"], - routingFilter: [], - processingModeFilter: [], - reverseTheQualityFilter: false, - deidentify: false, - deidentifiedValue: "", - timing: { - operation: "MERGE", - numberPerDay: 1440, - initialTime: "00:00", - timeZone: "EASTERN", - maxReportCount: 100, - whenEmpty: { - action: "NONE", - onlyOncePerDay: false, - }, - }, - description: "", - transport: { - host: "172.17.6.20", - port: "22", - filePath: "./upload", - credentialName: null, - type: "SFTP", - }, - version: 3, - createdBy: "jimfuqian@navapbc.com", - createdAt: "2024-01-19T01:44:40.928Z", - conditionFilter: [], - mappedConditionFilter: [], - externalName: "ELIMS Ignore Receiver", - enrichmentSchemaNames: [], - timeZone: null, - dateTimeFormat: "OFFSET", + "jurisdictionalFilter" : [ "matches(ordering_facility_state, IG)", "matches(ordering_facility_county, HL7)" ], + "qualityFilter" : [ ], + "routingFilter" : [ ], + "processingModeFilter" : [ ], + "reverseTheQualityFilter" : false, + "deidentify" : false, + "deidentifiedValue" : "", + "timing" : { + "operation" : "MERGE", + "numberPerDay" : 1440, + "initialTime" : "00:00", + "timeZone" : "EASTERN", + "maxReportCount" : 100, + "whenEmpty" : { + "action" : "NONE", + "onlyOncePerDay" : false + } }, -]; + "description" : "", + "transport" : { + "host" : "172.17.6.20", + "port" : "22", + "filePath" : "./upload", + "credentialName" : null, + "type" : "SFTP" + }, + "version" : null, + "createdBy" : null, + "createdAt" : null, + "conditionFilter" : [ ], + "mappedConditionFilter" : [ ], + "externalName" : null, + "enrichmentSchemaNames" : [ ], + "timeZone" : null, + "dateTimeFormat" : "OFFSET" +}, { + "name" : "QUALITY_PASS", + "organizationName" : "ignore", + "topic" : "covid-19", + "customerStatus" : "active", + "translation" : { + "schemaName" : "empty", + "format" : "CSV", + "useBatching" : false, + "defaults" : { }, + "nameFormat" : "standard", + "receivingOrganization" : null, + "type" : "CUSTOM" + }, + "jurisdictionalFilter" : [ "matches(ordering_facility_state, IG)", "matches(ordering_facility_county, QUALITY_PASS, removed)" ], + "qualityFilter" : [ "hasValidDataFor(message_id,ordering_facility_county,ordering_facility_state)", "hasAtLeastOneOf(message_id,blankField)", "matches(ordering_facility_county, QUALITY_PASS)" ], + "routingFilter" : [ ], + "processingModeFilter" : [ ], + "reverseTheQualityFilter" : false, + "deidentify" : false, + "deidentifiedValue" : "", + "timing" : null, + "description" : "", + "transport" : null, + "version" : null, + "createdBy" : null, + "createdAt" : null, + "conditionFilter" : [ ], + "mappedConditionFilter" : [ ], + "externalName" : null, + "enrichmentSchemaNames" : [ ], + "timeZone" : null, + "dateTimeFormat" : "OFFSET" +}, { + "name" : "QUALITY_REVERSED", + "organizationName" : "ignore", + "topic" : "covid-19", + "customerStatus" : "active", + "translation" : { + "schemaName" : "empty", + "format" : "CSV", + "useBatching" : false, + "defaults" : { }, + "nameFormat" : "standard", + "receivingOrganization" : null, + "type" : "CUSTOM" + }, + "jurisdictionalFilter" : [ "matches(ordering_facility_state, IG)", "matches(ordering_facility_county, QUALITY_REVERSED, kept)" ], + "qualityFilter" : [ "hasValidDataFor(message_id,ordering_facility_county,ordering_facility_state)", "hasAtLeastOneOf(message_id,blankField)", "matches(ordering_facility_county, QUALITY_REVERSED)" ], + "routingFilter" : [ ], + "processingModeFilter" : [ ], + "reverseTheQualityFilter" : true, + "deidentify" : false, + "deidentifiedValue" : "", + "timing" : null, + "description" : "", + "transport" : null, + "version" : null, + "createdBy" : null, + "createdAt" : null, + "conditionFilter" : [ ], + "mappedConditionFilter" : [ ], + "externalName" : null, + "enrichmentSchemaNames" : [ ], + "timeZone" : null, + "dateTimeFormat" : "OFFSET" +}, { + "name" : "BLOBSTORE", + "organizationName" : "ignore", + "topic" : "covid-19", + "customerStatus" : "active", + "translation" : { + "schemaName" : "hhsprotect/hhsprotect-covid-19", + "format" : "CSV", + "useBatching" : false, + "defaults" : { }, + "nameFormat" : "STANDARD", + "receivingOrganization" : null, + "type" : "CUSTOM" + }, + "jurisdictionalFilter" : [ "matches(ordering_facility_state, IG)", "matches(ordering_facility_county, BLOBSTORE)" ], + "qualityFilter" : [ ], + "routingFilter" : [ ], + "processingModeFilter" : [ ], + "reverseTheQualityFilter" : false, + "deidentify" : true, + "deidentifiedValue" : "", + "timing" : { + "operation" : "MERGE", + "numberPerDay" : 1440, + "initialTime" : "00:00", + "timeZone" : "EASTERN", + "maxReportCount" : 100, + "whenEmpty" : { + "action" : "NONE", + "onlyOncePerDay" : false + } + }, + "description" : "", + "transport" : { + "storageName" : "PartnerStorage", + "containerName" : "hhsprotect", + "type" : "BLOBSTORE" + }, + "version" : null, + "createdBy" : null, + "createdAt" : null, + "conditionFilter" : [ ], + "mappedConditionFilter" : [ ], + "externalName" : null, + "enrichmentSchemaNames" : [ ], + "timeZone" : null, + "dateTimeFormat" : "OFFSET" +}, { + "name" : "CSV", + "organizationName" : "ignore", + "topic" : "covid-19", + "customerStatus" : "active", + "translation" : { + "schemaName" : "az/pima-az-covid-19", + "format" : "CSV", + "useBatching" : false, + "defaults" : { }, + "nameFormat" : "STANDARD", + "receivingOrganization" : null, + "type" : "CUSTOM" + }, + "jurisdictionalFilter" : [ "matches(ordering_facility_state, IG)", "matches(ordering_facility_county, CSV)" ], + "qualityFilter" : [ ], + "routingFilter" : [ ], + "processingModeFilter" : [ ], + "reverseTheQualityFilter" : false, + "deidentify" : false, + "deidentifiedValue" : "", + "timing" : { + "operation" : "MERGE", + "numberPerDay" : 1440, + "initialTime" : "00:00", + "timeZone" : "EASTERN", + "maxReportCount" : 100, + "whenEmpty" : { + "action" : "NONE", + "onlyOncePerDay" : false + } + }, + "description" : "For testing only.", + "transport" : { + "host" : "172.17.6.20", + "port" : "22", + "filePath" : "./upload", + "credentialName" : null, + "type" : "SFTP" + }, + "version" : null, + "createdBy" : null, + "createdAt" : null, + "conditionFilter" : [ ], + "mappedConditionFilter" : [ ], + "externalName" : null, + "enrichmentSchemaNames" : [ ], + "timeZone" : null, + "dateTimeFormat" : "OFFSET" +}, { + "name" : "HL7_NULL", + "organizationName" : "ignore", + "topic" : "covid-19", + "customerStatus" : "active", + "translation" : { + "schemaName" : "tx/tx-covid-19", + "format" : "HL7_BATCH", + "useBatching" : false, + "defaults" : { }, + "nameFormat" : "STANDARD", + "receivingOrganization" : null, + "type" : "CUSTOM" + }, + "jurisdictionalFilter" : [ "matches(ordering_facility_state, IG)", "matches(ordering_facility_county, HL7_NULL)" ], + "qualityFilter" : [ ], + "routingFilter" : [ ], + "processingModeFilter" : [ ], + "reverseTheQualityFilter" : false, + "deidentify" : false, + "deidentifiedValue" : "", + "timing" : { + "operation" : "MERGE", + "numberPerDay" : 1440, + "initialTime" : "00:00", + "timeZone" : "EASTERN", + "maxReportCount" : 100, + "whenEmpty" : { + "action" : "NONE", + "onlyOncePerDay" : false + } + }, + "description" : "", + "transport" : { + "dummy" : null, + "type" : "NULL" + }, + "version" : null, + "createdBy" : null, + "createdAt" : null, + "conditionFilter" : [ ], + "mappedConditionFilter" : [ ], + "externalName" : null, + "enrichmentSchemaNames" : [ ], + "timeZone" : null, + "dateTimeFormat" : "OFFSET" +}, { + "name" : "EVERY_5_MINS", + "organizationName" : "ignore", + "topic" : "covid-19", + "customerStatus" : "active", + "translation" : { + "schemaName" : "covid-19", + "useTestProcessingMode" : false, + "useBatchHeaders" : true, + "receivingApplicationName" : null, + "receivingApplicationOID" : null, + "receivingFacilityName" : null, + "receivingFacilityOID" : null, + "messageProfileId" : null, + "replaceValue" : { }, + "replaceValueAwithB" : { }, + "reportingFacilityName" : null, + "reportingFacilityId" : null, + "reportingFacilityIdType" : null, + "suppressQstForAoe" : false, + "suppressHl7Fields" : null, + "suppressAoe" : false, + "defaultAoeToUnknown" : false, + "replaceUnicodeWithAscii" : false, + "useBlankInsteadOfUnknown" : null, + "truncateHDNamespaceIds" : false, + "truncateHl7Fields" : null, + "usePid14ForPatientEmail" : false, + "convertTimestampToDateTime" : null, + "cliaForOutOfStateTesting" : null, + "cliaForSender" : { }, + "phoneNumberFormatting" : "STANDARD", + "suppressNonNPI" : false, + "processingModeCode" : null, + "replaceDiiWithOid" : null, + "applyOTCDefault" : false, + "useOrderingFacilityName" : "STANDARD", + "valueSetOverrides" : { }, + "nameFormat" : "standard", + "receivingOrganization" : null, + "convertPositiveDateTimeOffsetToNegative" : false, + "stripInvalidCharsRegex" : null, + "convertDateTimesToReceiverLocalTime" : false, + "useHighPrecisionHeaderDateTimeFormat" : false, + "type" : "HL7", + "truncationConfig" : { + "truncateHDNamespaceIds" : false, + "truncateHl7Fields" : [ ], + "customLengthHl7Fields" : { } + } + }, + "jurisdictionalFilter" : [ "matches(ordering_facility_state, IG)", "matches(ordering_facility_county, EVERY_5_MINS)" ], + "qualityFilter" : [ ], + "routingFilter" : [ ], + "processingModeFilter" : [ ], + "reverseTheQualityFilter" : false, + "deidentify" : false, + "deidentifiedValue" : "", + "timing" : { + "operation" : "MERGE", + "numberPerDay" : 288, + "initialTime" : "00:00", + "timeZone" : "EASTERN", + "maxReportCount" : 100, + "whenEmpty" : { + "action" : "NONE", + "onlyOncePerDay" : false + } + }, + "description" : "", + "transport" : { + "host" : "172.17.6.20", + "port" : "22", + "filePath" : "./upload", + "credentialName" : null, + "type" : "SFTP" + }, + "version" : null, + "createdBy" : null, + "createdAt" : null, + "conditionFilter" : [ ], + "mappedConditionFilter" : [ ], + "externalName" : "Batches and Sends every 5 minutes. For Load testing.", + "enrichmentSchemaNames" : [ ], + "timeZone" : null, + "dateTimeFormat" : "OFFSET" +}, { + "name" : "EVERY_15_MINS", + "organizationName" : "ignore", + "topic" : "covid-19", + "customerStatus" : "active", + "translation" : { + "schemaName" : "covid-19", + "useTestProcessingMode" : false, + "useBatchHeaders" : true, + "receivingApplicationName" : null, + "receivingApplicationOID" : null, + "receivingFacilityName" : null, + "receivingFacilityOID" : null, + "messageProfileId" : null, + "replaceValue" : { }, + "replaceValueAwithB" : { }, + "reportingFacilityName" : null, + "reportingFacilityId" : null, + "reportingFacilityIdType" : null, + "suppressQstForAoe" : false, + "suppressHl7Fields" : null, + "suppressAoe" : false, + "defaultAoeToUnknown" : false, + "replaceUnicodeWithAscii" : false, + "useBlankInsteadOfUnknown" : null, + "truncateHDNamespaceIds" : false, + "truncateHl7Fields" : null, + "usePid14ForPatientEmail" : false, + "convertTimestampToDateTime" : null, + "cliaForOutOfStateTesting" : null, + "cliaForSender" : { }, + "phoneNumberFormatting" : "STANDARD", + "suppressNonNPI" : false, + "processingModeCode" : null, + "replaceDiiWithOid" : null, + "applyOTCDefault" : false, + "useOrderingFacilityName" : "STANDARD", + "valueSetOverrides" : { }, + "nameFormat" : "standard", + "receivingOrganization" : null, + "convertPositiveDateTimeOffsetToNegative" : false, + "stripInvalidCharsRegex" : null, + "convertDateTimesToReceiverLocalTime" : false, + "useHighPrecisionHeaderDateTimeFormat" : false, + "type" : "HL7", + "truncationConfig" : { + "truncateHDNamespaceIds" : false, + "truncateHl7Fields" : [ ], + "customLengthHl7Fields" : { } + } + }, + "jurisdictionalFilter" : [ "matches(ordering_facility_state, IG)", "matches(ordering_facility_county, EVERY_15_MINS)" ], + "qualityFilter" : [ ], + "routingFilter" : [ ], + "processingModeFilter" : [ ], + "reverseTheQualityFilter" : false, + "deidentify" : false, + "deidentifiedValue" : "", + "timing" : { + "operation" : "MERGE", + "numberPerDay" : 96, + "initialTime" : "00:00", + "timeZone" : "EASTERN", + "maxReportCount" : 100, + "whenEmpty" : { + "action" : "NONE", + "onlyOncePerDay" : false + } + }, + "description" : "", + "transport" : { + "host" : "172.17.6.20", + "port" : "22", + "filePath" : "./upload", + "credentialName" : null, + "type" : "SFTP" + }, + "version" : null, + "createdBy" : null, + "createdAt" : null, + "conditionFilter" : [ ], + "mappedConditionFilter" : [ ], + "externalName" : "Batches and Sends every 15 minutes. For Load testing.", + "enrichmentSchemaNames" : [ ], + "timeZone" : null, + "dateTimeFormat" : "OFFSET" +}, { + "name" : "SETTINGS_TEST", + "organizationName" : "ignore", + "topic" : "covid-19", + "customerStatus" : "active", + "translation" : { + "schemaName" : "empty", + "format" : "CSV", + "useBatching" : false, + "defaults" : { }, + "nameFormat" : "standard", + "receivingOrganization" : null, + "type" : "CUSTOM" + }, + "jurisdictionalFilter" : [ "matches(ordering_facility_county, SETTINGS_TEST)" ], + "qualityFilter" : [ "allowAll()" ], + "routingFilter" : [ "matches(sender_fullname, ignore.ignore-empty)", "matches(sender_orgname, ignore)" ], + "processingModeFilter" : [ "matches(processing_mode_code, P)" ], + "reverseTheQualityFilter" : false, + "deidentify" : false, + "deidentifiedValue" : "", + "timing" : { + "operation" : "MERGE", + "numberPerDay" : 1440, + "initialTime" : "00:00", + "timeZone" : "EASTERN", + "maxReportCount" : 100, + "whenEmpty" : { + "action" : "NONE", + "onlyOncePerDay" : false + } + }, + "description" : "", + "transport" : { + "host" : "172.17.6.20", + "port" : "22", + "filePath" : "./upload", + "credentialName" : null, + "type" : "SFTP" + }, + "version" : null, + "createdBy" : null, + "createdAt" : null, + "conditionFilter" : [ ], + "mappedConditionFilter" : [ ], + "externalName" : "Used to test putting sender settings into the data, using ignore.ignore-empty", + "enrichmentSchemaNames" : [ ], + "timeZone" : null, + "dateTimeFormat" : "OFFSET" +}, { + "name" : "HL7_BATCH", + "organizationName" : "ignore", + "topic" : "covid-19", + "customerStatus" : "active", + "translation" : { + "schemaName" : "az/az-covid-19-hl7", + "format" : "HL7_BATCH", + "useBatching" : false, + "defaults" : { }, + "nameFormat" : "STANDARD", + "receivingOrganization" : null, + "type" : "CUSTOM" + }, + "jurisdictionalFilter" : [ "matches(ordering_facility_county, HL7_BATCH)", "matches(ordering_facility_state, IG)" ], + "qualityFilter" : [ ], + "routingFilter" : [ ], + "processingModeFilter" : [ ], + "reverseTheQualityFilter" : false, + "deidentify" : false, + "deidentifiedValue" : "", + "timing" : { + "operation" : "MERGE", + "numberPerDay" : 1440, + "initialTime" : "00:00", + "timeZone" : "EASTERN", + "maxReportCount" : 100, + "whenEmpty" : { + "action" : "NONE", + "onlyOncePerDay" : false + } + }, + "description" : "", + "transport" : { + "host" : "172.17.6.20", + "port" : "22", + "filePath" : "./upload", + "credentialName" : null, + "type" : "SFTP" + }, + "version" : null, + "createdBy" : null, + "createdAt" : null, + "conditionFilter" : [ ], + "mappedConditionFilter" : [ ], + "externalName" : null, + "enrichmentSchemaNames" : [ ], + "timeZone" : null, + "dateTimeFormat" : "OFFSET" +}, { + "name" : "FULL_ELR_FHIR", + "organizationName" : "ignore", + "topic" : "full-elr", + "customerStatus" : "active", + "translation" : { + "schemaName" : "", + "useBatching" : true, + "nameFormat" : "standard", + "receivingOrganization" : null, + "type" : "FHIR" + }, + "jurisdictionalFilter" : [ "(Bundle.entry.resource.ofType(ServiceRequest)[0].requester.resolve().organization.resolve().address.state.exists() and Bundle.entry.resource.ofType(ServiceRequest)[0].requester.resolve().organization.resolve().address.state = 'IG') or (Bundle.entry.resource.ofType(Patient).address.state.exists() and Bundle.entry.resource.ofType(Patient).address.state = 'IG')" ], + "qualityFilter" : [ "Bundle.entry.resource.ofType(MessageHeader).id.exists()", "Bundle.entry.resource.ofType(Patient).birthDate.exists()", "Bundle.entry.resource.ofType(Patient).name.family.exists()", "Bundle.entry.resource.ofType(Patient).name.given.count() > 0", "Bundle.entry.resource.ofType(Specimen).type.exists()", "(Bundle.entry.resource.ofType(Patient).address.line.exists() or Bundle.entry.resource.ofType(Patient).address.postalCode.exists() or Bundle.entry.resource.ofType(Patient).telecom.exists())", "((Bundle.entry.resource.ofType(Specimen).collection.collectedPeriod.exists() or Bundle.entry.resource.ofType(Specimen).collection.collected.exists()) or Bundle.entry.resource.ofType(ServiceRequest).occurrence.exists() or Bundle.entry.resource.ofType(Observation).effective.exists())" ], + "routingFilter" : [ ], + "processingModeFilter" : [ "Bundle.entry.resource.ofType(MessageHeader).extension('https://reportstream.cdc.gov/fhir/StructureDefinition/sender-id').exists().not() or Bundle.entry.resource.ofType(MessageHeader).extension('https://reportstream.cdc.gov/fhir/StructureDefinition/sender-id').value != 'hcintegrations'" ], + "reverseTheQualityFilter" : false, + "deidentify" : false, + "deidentifiedValue" : "", + "timing" : { + "operation" : "MERGE", + "numberPerDay" : 1440, + "initialTime" : "00:00", + "timeZone" : "EASTERN", + "maxReportCount" : 100, + "whenEmpty" : { + "action" : "NONE", + "onlyOncePerDay" : false + } + }, + "description" : "", + "transport" : { + "host" : "172.17.6.20", + "port" : "22", + "filePath" : "./upload", + "credentialName" : null, + "type" : "SFTP" + }, + "version" : null, + "createdBy" : null, + "createdAt" : null, + "conditionFilter" : [ ], + "mappedConditionFilter" : [ ], + "externalName" : "Ignore FULL_ELR_FHIR", + "enrichmentSchemaNames" : [ ], + "timeZone" : null, + "dateTimeFormat" : "OFFSET" +}, { + "name" : "FULL_ELR", + "organizationName" : "ignore", + "topic" : "full-elr", + "customerStatus" : "active", + "translation" : { + "schemaName" : "classpath:/metadata/hl7_mapping/receivers/STLTs/CO/CO.yml", + "useTestProcessingMode" : false, + "useBatchHeaders" : true, + "receivingApplicationName" : "CA-ELR", + "receivingApplicationOID" : null, + "receivingFacilityName" : "CA", + "receivingFacilityOID" : null, + "messageProfileId" : null, + "replaceValue" : { }, + "replaceValueAwithB" : { }, + "reportingFacilityName" : null, + "reportingFacilityId" : null, + "reportingFacilityIdType" : null, + "suppressQstForAoe" : false, + "suppressHl7Fields" : null, + "suppressAoe" : false, + "defaultAoeToUnknown" : false, + "replaceUnicodeWithAscii" : false, + "useBlankInsteadOfUnknown" : null, + "truncateHDNamespaceIds" : false, + "truncateHl7Fields" : null, + "usePid14ForPatientEmail" : false, + "convertTimestampToDateTime" : null, + "cliaForOutOfStateTesting" : null, + "cliaForSender" : { }, + "phoneNumberFormatting" : "STANDARD", + "suppressNonNPI" : false, + "processingModeCode" : null, + "replaceDiiWithOid" : null, + "applyOTCDefault" : false, + "useOrderingFacilityName" : "STANDARD", + "valueSetOverrides" : { }, + "nameFormat" : "standard", + "receivingOrganization" : null, + "convertPositiveDateTimeOffsetToNegative" : false, + "stripInvalidCharsRegex" : null, + "convertDateTimesToReceiverLocalTime" : false, + "useHighPrecisionHeaderDateTimeFormat" : false, + "type" : "HL7", + "truncationConfig" : { + "truncateHDNamespaceIds" : false, + "truncateHl7Fields" : [ ], + "customLengthHl7Fields" : { } + } + }, + "jurisdictionalFilter" : [ "(Bundle.entry.resource.ofType(ServiceRequest)[0].requester.resolve().organization.resolve().address.state.exists() and Bundle.entry.resource.ofType(ServiceRequest)[0].requester.resolve().organization.resolve().address.state = 'IG') or (Bundle.entry.resource.ofType(Patient).address.state.exists() and Bundle.entry.resource.ofType(Patient).address.state = 'IG')" ], + "qualityFilter" : [ "Bundle.entry.resource.ofType(MessageHeader).id.exists()", "Bundle.entry.resource.ofType(Patient).birthDate.exists()", "Bundle.entry.resource.ofType(Patient).name.family.exists()", "Bundle.entry.resource.ofType(Patient).name.given.count() > 0", "Bundle.entry.resource.ofType(Specimen).type.exists()", "(Bundle.entry.resource.ofType(Patient).address.line.exists() or Bundle.entry.resource.ofType(Patient).address.postalCode.exists() or Bundle.entry.resource.ofType(Patient).telecom.exists())", "((Bundle.entry.resource.ofType(Specimen).collection.collectedPeriod.exists() or Bundle.entry.resource.ofType(Specimen).collection.collected.exists()) or Bundle.entry.resource.ofType(ServiceRequest).occurrence.exists() or Bundle.entry.resource.ofType(Observation).effective.exists())" ], + "routingFilter" : [ ], + "processingModeFilter" : [ "Bundle.entry.resource.ofType(MessageHeader).extension('https://reportstream.cdc.gov/fhir/StructureDefinition/sender-id').exists().not() or Bundle.entry.resource.ofType(MessageHeader).extension('https://reportstream.cdc.gov/fhir/StructureDefinition/sender-id').value != 'hcintegrations'" ], + "reverseTheQualityFilter" : false, + "deidentify" : false, + "deidentifiedValue" : "", + "timing" : { + "operation" : "MERGE", + "numberPerDay" : 1440, + "initialTime" : "00:00", + "timeZone" : "EASTERN", + "maxReportCount" : 100, + "whenEmpty" : { + "action" : "NONE", + "onlyOncePerDay" : false + } + }, + "description" : "", + "transport" : { + "host" : "172.17.6.20", + "port" : "22", + "filePath" : "./upload", + "credentialName" : null, + "type" : "SFTP" + }, + "version" : null, + "createdBy" : null, + "createdAt" : null, + "conditionFilter" : [ ], + "mappedConditionFilter" : [ ], + "externalName" : "Ignore FULL_ELR", + "enrichmentSchemaNames" : [ ], + "timeZone" : null, + "dateTimeFormat" : "OFFSET" +}, { + "name" : "ELR_ELIMS", + "organizationName" : "ignore", + "topic" : "elr-elims", + "customerStatus" : "active", + "translation" : { + "schemaName" : "classpath:/metadata/hl7_mapping/ORU_R01/ORU_R01-base.yml", + "useTestProcessingMode" : false, + "useBatchHeaders" : true, + "receivingApplicationName" : null, + "receivingApplicationOID" : null, + "receivingFacilityName" : null, + "receivingFacilityOID" : null, + "messageProfileId" : null, + "replaceValue" : { }, + "replaceValueAwithB" : { }, + "reportingFacilityName" : null, + "reportingFacilityId" : null, + "reportingFacilityIdType" : null, + "suppressQstForAoe" : false, + "suppressHl7Fields" : null, + "suppressAoe" : false, + "defaultAoeToUnknown" : false, + "replaceUnicodeWithAscii" : false, + "useBlankInsteadOfUnknown" : null, + "truncateHDNamespaceIds" : false, + "truncateHl7Fields" : null, + "usePid14ForPatientEmail" : false, + "convertTimestampToDateTime" : null, + "cliaForOutOfStateTesting" : null, + "cliaForSender" : { }, + "phoneNumberFormatting" : "STANDARD", + "suppressNonNPI" : false, + "processingModeCode" : null, + "replaceDiiWithOid" : null, + "applyOTCDefault" : false, + "useOrderingFacilityName" : "STANDARD", + "valueSetOverrides" : { }, + "nameFormat" : "standard", + "receivingOrganization" : null, + "convertPositiveDateTimeOffsetToNegative" : false, + "stripInvalidCharsRegex" : null, + "convertDateTimesToReceiverLocalTime" : false, + "useHighPrecisionHeaderDateTimeFormat" : false, + "type" : "HL7", + "truncationConfig" : { + "truncateHDNamespaceIds" : false, + "truncateHl7Fields" : [ ], + "customLengthHl7Fields" : { } + } + }, + "jurisdictionalFilter" : [ "(Bundle.entry.resource.ofType(ServiceRequest)[0].requester.resolve().organization.resolve().address.state.exists() and Bundle.entry.resource.ofType(ServiceRequest)[0].requester.resolve().organization.resolve().address.state = 'IG') or (Bundle.entry.resource.ofType(Patient).address.state.exists() and Bundle.entry.resource.ofType(Patient).address.state = 'IG')" ], + "qualityFilter" : [ "true" ], + "routingFilter" : [ ], + "processingModeFilter" : [ ], + "reverseTheQualityFilter" : false, + "deidentify" : false, + "deidentifiedValue" : "", + "timing" : { + "operation" : "MERGE", + "numberPerDay" : 1440, + "initialTime" : "00:00", + "timeZone" : "EASTERN", + "maxReportCount" : 100, + "whenEmpty" : { + "action" : "NONE", + "onlyOncePerDay" : false + } + }, + "description" : "", + "transport" : { + "host" : "172.17.6.20", + "port" : "22", + "filePath" : "./upload", + "credentialName" : null, + "type" : "SFTP" + }, + "version" : null, + "createdBy" : null, + "createdAt" : null, + "conditionFilter" : [ ], + "mappedConditionFilter" : [ ], + "externalName" : "ELIMS Ignore Receiver", + "enrichmentSchemaNames" : [ ], + "timeZone" : null, + "dateTimeFormat" : "OFFSET" +}]; + +export const MOCK_GET_SENDERS_IGNORE = [ { + "name" : "ignore-empty", + "organizationName" : "ignore", + "format" : "CSV", + "customerStatus" : "active", + "schemaName" : "empty", + "processingType" : "sync", + "allowDuplicates" : true, + "senderType" : null, + "primarySubmissionMethod" : null, + "topic" : "covid-19", + "version" : null, + "createdBy" : null, + "createdAt" : null +}, { + "name" : "ignore-simple-report", + "organizationName" : "ignore", + "format" : "CSV", + "customerStatus" : "active", + "schemaName" : "primedatainput/pdi-covid-19", + "processingType" : "sync", + "allowDuplicates" : true, + "senderType" : null, + "primarySubmissionMethod" : null, + "topic" : "covid-19", + "version" : null, + "createdBy" : null, + "createdAt" : null +}, { + "name" : "ignore-waters", + "organizationName" : "ignore", + "format" : "CSV", + "customerStatus" : "active", + "schemaName" : "waters/waters-covid-19", + "processingType" : "sync", + "allowDuplicates" : true, + "senderType" : null, + "primarySubmissionMethod" : null, + "topic" : "covid-19", + "version" : null, + "createdBy" : null, + "createdAt" : null +}, { + "name" : "ignore-hl7", + "organizationName" : "ignore", + "format" : "HL7", + "customerStatus" : "active", + "schemaName" : "hl7/test-covid-19", + "processingType" : "sync", + "allowDuplicates" : true, + "senderType" : null, + "primarySubmissionMethod" : null, + "topic" : "covid-19", + "version" : null, + "createdBy" : null, + "createdAt" : null +}, { + "name" : "ignore-full-elr", + "organizationName" : "ignore", + "format" : "HL7", + "customerStatus" : "active", + "schemaName" : "", + "processingType" : "sync", + "allowDuplicates" : true, + "senderType" : null, + "primarySubmissionMethod" : null, + "topic" : "full-elr", + "version" : null, + "createdBy" : null, + "createdAt" : null +}, { + "name" : "default", + "organizationName" : "ignore", + "format" : "CSV", + "customerStatus" : "active", + "schemaName" : "primedatainput/pdi-covid-19", + "processingType" : "sync", + "allowDuplicates" : true, + "senderType" : null, + "primarySubmissionMethod" : null, + "topic" : "covid-19", + "version" : null, + "createdBy" : null, + "createdAt" : null +}, { + "name" : "ignore-elr-elims", + "organizationName" : "ignore", + "format" : "HL7", + "customerStatus" : "active", + "schemaName" : "classpath:/metadata/fhir_transforms/senders/original-pipeline-transforms.yml", + "processingType" : "sync", + "allowDuplicates" : true, + "senderType" : null, + "primarySubmissionMethod" : null, + "topic" : "elr-elims", + "version" : null, + "createdBy" : null, + "createdAt" : null +}, { + "name" : "ignore-full-elr-e2e", + "organizationName" : "ignore", + "format" : "HL7", + "customerStatus" : "active", + "schemaName" : "classpath:/metadata/fhir_transforms/senders/baseline-sender-transform.yml", + "processingType" : "sync", + "allowDuplicates" : true, + "senderType" : null, + "primarySubmissionMethod" : null, + "topic" : "full-elr", + "version" : null, + "createdBy" : null, + "createdAt" : null +} ] + +export const MOCK_GET_ORGANIZATION_IGNORE = { + "name" : "ignore", + "description" : "FOR TESTING ONLY", + "jurisdiction" : "FEDERAL", + "filters" : [ { + "topic" : "covid-19", + "jurisdictionalFilter" : [ "matches(ordering_facility_state, IG)" ], + "qualityFilter" : null, + "routingFilter" : null, + "processingModeFilter" : null, + "conditionFilter" : null, + "mappedConditionFilter" : null + }, { + "topic" : "monkeypox", + "jurisdictionalFilter" : [ "matches(ordering_facility_state, IG)" ], + "qualityFilter" : null, + "routingFilter" : null, + "processingModeFilter" : null, + "conditionFilter" : null, + "mappedConditionFilter" : null + }, { + "topic" : "full-elr", + "jurisdictionalFilter" : [ "(Bundle.entry.resource.ofType(ServiceRequest)[0].requester.resolve().organization.resolve().address.state.exists() and Bundle.entry.resource.ofType(ServiceRequest)[0].requester.resolve().organization.resolve().address.state = 'IG') or (Bundle.entry.resource.ofType(Patient).address.state.exists() and Bundle.entry.resource.ofType(Patient).address.state = 'IG')" ], + "qualityFilter" : [ "(Bundle.entry.resource.ofType(MessageHeader).event.code.exists() and Bundle.entry.resource.ofType(MessageHeader).event.code = 'R01')" ], + "routingFilter" : null, + "processingModeFilter" : null, + "conditionFilter" : null, + "mappedConditionFilter" : null + }, { + "topic" : "mars-otc-elr", + "jurisdictionalFilter" : [ "Bundle.entry.resource.ofType(Patient).address.state.exists() and Bundle.entry.resource.ofType(Patient).address.state = 'IG'" ], + "qualityFilter" : null, + "routingFilter" : null, + "processingModeFilter" : null, + "conditionFilter" : null, + "mappedConditionFilter" : null + } ], + "featureFlags" : [ ], + "keys" : [ { + "scope" : "ignore.*.admin", + "keys" : [ { + "kty" : "EC", + "kid" : "adminkey", + "crv" : "P-384", + "x" : "78eOugxhQPd_tUKOhsfcZ04bp_xgL2kuJN6ZrNgWv6qZXHXqoqVKVXlzO_Q9NXdn", + "y" : "Zo7eBcyQpAarTANsPKB95xT69Ue_cCyp1DBmTRk3nJBBhF6XZkT-AaYaXmGhPNWG" + } ] + }, { + "scope" : "ignore.*.report", + "keys" : [ ] + } ], + "version" : 2197, + "createdBy" : "ignore.*.admin_8e376400-dd3d-452c-973b-ea38358c4b7d", + "createdAt" : "2024-09-16T15:18:36.062Z" +} export const MOCK_GET_ORGANIZATION_SETTINGS_LIST = [ { diff --git a/frontend-react/e2e/pages/BasePage.ts b/frontend-react/e2e/pages/BasePage.ts index ea831731a04..066f2cdec8f 100644 --- a/frontend-react/e2e/pages/BasePage.ts +++ b/frontend-react/e2e/pages/BasePage.ts @@ -89,8 +89,8 @@ export abstract class BasePage { typeof err === "function" || typeof err === "object" ? err : { - status: typeof err === "number" ? err : 500, - }; + status: typeof err === "number" ? err : 500, + }; } /** @@ -134,9 +134,11 @@ export abstract class BasePage { ); } - async testHeader() { + async testHeader(hasHeading = true) { await expect(this.page).toHaveTitle(this.title); - await expect(this.heading).toBeVisible(); + if (hasHeading) { + await expect(this.heading).toBeVisible(); + } } async testCard(card: { name: string }) { diff --git a/frontend-react/e2e/pages/authenticated/last-mile-failures.ts b/frontend-react/e2e/pages/authenticated/admin/last-mile-failures.ts similarity index 94% rename from frontend-react/e2e/pages/authenticated/last-mile-failures.ts rename to frontend-react/e2e/pages/authenticated/admin/last-mile-failures.ts index bfc8c1bccea..9b51f5ea855 100644 --- a/frontend-react/e2e/pages/authenticated/last-mile-failures.ts +++ b/frontend-react/e2e/pages/authenticated/admin/last-mile-failures.ts @@ -1,8 +1,8 @@ import { expect, Locator } from "@playwright/test"; import { startOfDay, subDays } from "date-fns"; -import { tableRows } from "../../helpers/utils"; -import { MOCK_GET_RESEND, MOCK_GET_SEND_FAILURES } from "../../mocks/lastMilefailures"; -import { BasePage, BasePageTestArgs, RouteHandlerFulfillEntry } from "../BasePage"; +import { tableRows } from "../../../helpers/utils"; +import { MOCK_GET_RESEND, MOCK_GET_SEND_FAILURES } from "../../../mocks/lastMilefailures"; +import { BasePage, BasePageTestArgs, RouteHandlerFulfillEntry } from "../../BasePage"; export class LastMileFailuresPage extends BasePage { static readonly URL_LAST_MILE = "/admin/lastmile"; diff --git a/frontend-react/e2e/pages/authenticated/message-details.ts b/frontend-react/e2e/pages/authenticated/admin/message-details.ts similarity index 92% rename from frontend-react/e2e/pages/authenticated/message-details.ts rename to frontend-react/e2e/pages/authenticated/admin/message-details.ts index 124831a1829..ce245bd7430 100644 --- a/frontend-react/e2e/pages/authenticated/message-details.ts +++ b/frontend-react/e2e/pages/authenticated/admin/message-details.ts @@ -1,7 +1,7 @@ import { MessageIDSearchPage } from "./message-id-search"; -import { MOCK_GET_MESSAGE } from "../../mocks/messages"; +import { MOCK_GET_MESSAGE } from "../../../mocks/messages"; -import { BasePage, BasePageTestArgs, RouteHandlerFulfillEntry } from "../BasePage"; +import { BasePage, BasePageTestArgs, RouteHandlerFulfillEntry } from "../../BasePage"; export class MessageDetailsPage extends BasePage { static readonly URL_MESSAGE_DETAILS = `/message-details/${MessageIDSearchPage.MESSAGE_ID}`; diff --git a/frontend-react/e2e/pages/authenticated/message-id-search.ts b/frontend-react/e2e/pages/authenticated/admin/message-id-search.ts similarity index 93% rename from frontend-react/e2e/pages/authenticated/message-id-search.ts rename to frontend-react/e2e/pages/authenticated/admin/message-id-search.ts index d708f3f10c3..bf13796ba95 100644 --- a/frontend-react/e2e/pages/authenticated/message-id-search.ts +++ b/frontend-react/e2e/pages/authenticated/admin/message-id-search.ts @@ -1,5 +1,5 @@ -import { MOCK_GET_MESSAGE, MOCK_GET_MESSAGES } from "../../mocks/messages"; -import { BasePage, BasePageTestArgs, RouteHandlerFulfillEntry } from "../BasePage"; +import { MOCK_GET_MESSAGE, MOCK_GET_MESSAGES } from "../../../mocks/messages"; +import { BasePage, BasePageTestArgs, RouteHandlerFulfillEntry } from "../../BasePage"; export class MessageIDSearchPage extends BasePage { static readonly URL_MESSAGE_ID_SEARCH = "/admin/message-tracker"; diff --git a/frontend-react/e2e/pages/authenticated/admin/organization-edit.ts b/frontend-react/e2e/pages/authenticated/admin/organization-edit.ts new file mode 100644 index 00000000000..b914b4ee2c7 --- /dev/null +++ b/frontend-react/e2e/pages/authenticated/admin/organization-edit.ts @@ -0,0 +1,182 @@ +import { expect, Locator, Page } from "@playwright/test"; +import { RSReceiver, RSSender } from "../../../../src/config/endpoints/settings"; +import { formatDate } from "../../../../src/utils/misc"; +import { + MOCK_GET_ORGANIZATION_IGNORE, + MOCK_GET_RECEIVERS_IGNORE, + MOCK_GET_SENDERS_IGNORE +} from "../../../mocks/organizations"; +import { BasePage, BasePageTestArgs, type RouteHandlerFulfillEntry } from "../../BasePage"; + +export class OrganizationEditPage extends BasePage { + static readonly URL_ORGANIZATION_EDIT = `/admin/orgsettings/org/ignore`; + static readonly API_ORGANIZATION_IGNORE = "/api/settings/organizations/ignore"; + static readonly API_SENDERS = "/api/settings/organizations/ignore/senders"; + static readonly API_RECEIVERS = "/api/settings/organizations/ignore/receivers"; + protected _organizationSenders: RSSender[]; + protected _organizationReceivers: RSReceiver[]; + + readonly orgSenderNew: { + cancel: Locator; + save: Locator; + } + readonly orgSenderEdit: { + modal: Locator; + cancelButton: Locator; + editJsonButton: Locator; + editJsonModal: { + save: Locator; + checkSyntax: Locator; + back: Locator; + }; + } + readonly orgReceiverNew: { + cancel: Locator; + save: Locator; + } + readonly orgReceiverEdit: { + modal: Locator; + cancelButton: Locator; + editJsonButton: Locator; + editJsonModal: { + save: Locator; + checkSyntax: Locator; + back: Locator; + }; + } + + constructor(testArgs: BasePageTestArgs) { + super( + { + url: OrganizationEditPage.URL_ORGANIZATION_EDIT, + title: "Organization edit - Admin", + }, + testArgs, + ); + + this._organizationSenders = []; + this._organizationReceivers = []; + + this.addMockRouteHandlers( + [this.createMockOrganizationIgnoreAPIHandler(), + this.createMockOrganizationSenderAPIHandler(), + this.createMockOrganizationReceiverAPIHandler()] + ); + this.orgSenderNew = { + cancel: this.page.getByRole("button", { + name: "Cancel", + }), + save: this.page.getByRole("button", { + name: "Save", + }), + } + this.orgSenderEdit = { + modal: this.page.getByTestId("modalWindow"), + cancelButton: this.page.getByRole("button", { + name: "Cancel", + }), + editJsonButton: this.page.getByRole("button", { + name: "Edit json and save...", + }), + editJsonModal: { + save: this.page.getByTestId("editCompareSaveButton"), + checkSyntax: this.page.getByTestId("editCheckSyntaxButton"), + back: this.page.getByRole("button", { + name: "Back", + }), + } + } + this.orgReceiverNew = { + cancel: this.page.getByRole("button", { + name: "Cancel", + }), + save: this.page.getByRole("button", { + name: "Save", + }), + } + + this.orgReceiverEdit = { + modal: this.page.getByTestId("modalWindow"), + cancelButton: this.page.getByRole("button", { + name: "Cancel", + }), + editJsonButton: this.page.getByRole("button", { + name: "Edit json and save...", + }), + editJsonModal: { + save: this.page.getByTestId("editCompareSaveButton"), + checkSyntax: this.page.getByTestId("editCheckSyntaxButton"), + back: this.page.getByRole("button", { + name: "Back", + }), + } + } + } + + get isPageLoadExpected() { + return super.isPageLoadExpected && this.testArgs.storageState === this.testArgs.adminLogin.path; + } + + createMockOrganizationIgnoreAPIHandler(): RouteHandlerFulfillEntry { + return [ + OrganizationEditPage.API_ORGANIZATION_IGNORE, + () => { + return { + json: MOCK_GET_ORGANIZATION_IGNORE, + }; + }, + ]; + } + + createMockOrganizationSenderAPIHandler(): RouteHandlerFulfillEntry { + return [ + OrganizationEditPage.API_SENDERS, + () => { + return { + json: MOCK_GET_SENDERS_IGNORE, + }; + }, + ]; + } + + createMockOrganizationReceiverAPIHandler(): RouteHandlerFulfillEntry { + return [ + OrganizationEditPage.API_RECEIVERS, + () => { + return { + json: MOCK_GET_RECEIVERS_IGNORE, + }; + }, + ]; + } + + async testTableHeaders() { + await expect(this.page.locator(".usa-table th").nth(0)).toHaveText(/Name/); + await expect(this.page.locator(".usa-table th").nth(1)).toHaveText(/Org Name/); + await expect(this.page.locator(".usa-table th").nth(2)).toHaveText(/Topic/); + await expect(this.page.locator(".usa-table th").nth(3)).toHaveText(/Status/); + await expect(this.page.locator(".usa-table th").nth(4)).toHaveText(/Meta/); + await expect(this.page.locator(".usa-table th").nth(4)).toHaveText(/Action/); + + return true; + } + + getOrgMeta(metaData: any){ + const { version, createdAt, createdBy } = metaData; + + // handle cases where individual metadata are not available + const versionDisplay = version || version === 0 ? `v${version} ` : ""; + const createdAtDisplay = createdAt + ? `[${formatDate(metaData.createdAt)}] ` + : ""; + const createdByDisplay = createdBy ?? ""; + + return `${versionDisplay}${createdAtDisplay}${createdByDisplay}`; + } + + getApplyButton(page: Page) { + return page.getByRole("button", { + name: "Apply", + }); + } +} diff --git a/frontend-react/e2e/pages/authenticated/organization.ts b/frontend-react/e2e/pages/authenticated/admin/organization.ts similarity index 90% rename from frontend-react/e2e/pages/authenticated/organization.ts rename to frontend-react/e2e/pages/authenticated/admin/organization.ts index 80a09aa4807..77f9b2be438 100644 --- a/frontend-react/e2e/pages/authenticated/organization.ts +++ b/frontend-react/e2e/pages/authenticated/admin/organization.ts @@ -1,7 +1,7 @@ import { expect } from "@playwright/test"; -import { RSOrganizationSettings } from "../../../src/config/endpoints/settings"; -import { MOCK_GET_ORGANIZATION_SETTINGS_LIST } from "../../mocks/organizations"; -import { BasePage, BasePageTestArgs, type RouteHandlerFulfillEntry } from "../BasePage"; +import { RSOrganizationSettings } from "../../../../src/config/endpoints/settings"; +import { MOCK_GET_ORGANIZATION_SETTINGS_LIST } from "../../../mocks/organizations"; +import { BasePage, BasePageTestArgs, type RouteHandlerFulfillEntry } from "../../BasePage"; export class OrganizationPage extends BasePage { static readonly API_ORGANIZATIONS = "/api/settings/organizations"; diff --git a/frontend-react/e2e/spec/all/authenticated/admin/last-mile-failures-page.spec.ts b/frontend-react/e2e/spec/all/authenticated/admin/last-mile-failures-page.spec.ts index ba01d3812c2..60bc2032f68 100644 --- a/frontend-react/e2e/spec/all/authenticated/admin/last-mile-failures-page.spec.ts +++ b/frontend-react/e2e/spec/all/authenticated/admin/last-mile-failures-page.spec.ts @@ -1,5 +1,5 @@ import { tableRows } from "../../../../helpers/utils"; -import { LastMileFailuresPage } from "../../../../pages/authenticated/last-mile-failures"; +import { LastMileFailuresPage } from "../../../../pages/authenticated/admin/last-mile-failures"; import { test as baseTest, expect } from "../../../../test"; export interface LastMileFailuresPageFixtures { diff --git a/frontend-react/e2e/spec/all/authenticated/admin/message-details-page.spec.ts b/frontend-react/e2e/spec/all/authenticated/admin/message-details-page.spec.ts index 2a101640d8c..e461e7beb02 100644 --- a/frontend-react/e2e/spec/all/authenticated/admin/message-details-page.spec.ts +++ b/frontend-react/e2e/spec/all/authenticated/admin/message-details-page.spec.ts @@ -2,8 +2,8 @@ import fs from "node:fs"; import { parseFileLocation } from "../../../../../src/utils/misc"; import { tableRows } from "../../../../helpers/utils"; import { MOCK_GET_MESSAGE } from "../../../../mocks/messages"; -import { MessageDetailsPage } from "../../../../pages/authenticated/message-details"; -import { MessageIDSearchPage } from "../../../../pages/authenticated/message-id-search"; +import { MessageDetailsPage } from "../../../../pages/authenticated/admin/message-details"; +import { MessageIDSearchPage } from "../../../../pages/authenticated/admin/message-id-search"; import { mockGetHistoryReportResponse } from "../../../../pages/authenticated/report-details"; import { test as baseTest, expect } from "../../../../test"; diff --git a/frontend-react/e2e/spec/all/authenticated/admin/message-id-search-page.spec.ts b/frontend-react/e2e/spec/all/authenticated/admin/message-id-search-page.spec.ts index 2ac84973da4..6af81d230eb 100644 --- a/frontend-react/e2e/spec/all/authenticated/admin/message-id-search-page.spec.ts +++ b/frontend-react/e2e/spec/all/authenticated/admin/message-id-search-page.spec.ts @@ -1,6 +1,6 @@ import { noData, tableRows } from "../../../../helpers/utils"; import { MOCK_GET_MESSAGES } from "../../../../mocks/messages"; -import { MessageIDSearchPage } from "../../../../pages/authenticated/message-id-search"; +import { MessageIDSearchPage } from "../../../../pages/authenticated/admin/message-id-search"; import { openReportIdDetailPage } from "../../../../pages/authenticated/submission-history"; import { test as baseTest, expect } from "../../../../test"; diff --git a/frontend-react/e2e/spec/all/authenticated/admin/organization-settings-edit-page.spec.ts b/frontend-react/e2e/spec/all/authenticated/admin/organization-settings-edit-page.spec.ts new file mode 100644 index 00000000000..4068bc091dd --- /dev/null +++ b/frontend-react/e2e/spec/all/authenticated/admin/organization-settings-edit-page.spec.ts @@ -0,0 +1,241 @@ +import { expect } from "@playwright/test"; +import { tableDataCellValue } from "../../../../helpers/utils"; +import { MOCK_GET_ORGANIZATION_IGNORE } from "../../../../mocks/organizations"; +import { OrganizationEditPage } from "../../../../pages/authenticated/admin/organization-edit"; +import { test as baseTest } from "../../../../test"; + +export interface OrganizationEditPageFixtures { + organizationEditPage: OrganizationEditPage; +} + +const test = baseTest.extend({ + organizationEditPage: async ( + { + page: _page, + isMockDisabled, + adminLogin, + senderLogin, + receiverLogin, + storageState, + frontendWarningsLogPath, + isFrontendWarningsLog, + }, + use, + ) => { + const page = new OrganizationEditPage({ + page: _page, + isMockDisabled, + adminLogin, + senderLogin, + receiverLogin, + storageState, + frontendWarningsLogPath, + isFrontendWarningsLog, + }); + await page.goto(); + await use(page); + }, +}); + +test.describe("Organization Edit Page", () => { + test.describe("not authenticated", () => { + test("redirects to login", async ({ organizationEditPage }) => { + await expect(organizationEditPage.page).toHaveURL("/login"); + }); + }); + + test.describe("receiver user", () => { + test.use({ storageState: "e2e/.auth/receiver.json" }); + test("returns Page Not Found", async ({ organizationEditPage }) => { + await expect(organizationEditPage.page).toHaveTitle(/Page Not Found/); + }); + }); + + test.describe("sender user", () => { + test.use({ storageState: "e2e/.auth/sender.json" }); + test("returns Page Not Found", async ({ organizationEditPage }) => { + await expect(organizationEditPage.page).toHaveTitle(/Page Not Found/); + }); + }); + + test.describe("admin user", () => { + test.use({ storageState: "e2e/.auth/admin.json" }); + + test.describe("header", () => { + test("has correct title", async ({ organizationEditPage }) => { + await organizationEditPage.testHeader(false); + }); + }); + + test.describe("when there is an error", () => { + test("the error is shown on the page", async ({ organizationEditPage }) => { + organizationEditPage.mockError = true; + await organizationEditPage.reload(); + await expect(organizationEditPage.page.getByText("there was an error")).toBeVisible(); + }); + }); + + test.describe("when there is no error", () => { + test("has correct title", async ({ organizationEditPage }) => { + await organizationEditPage.testHeader(false); + }); + + test.describe("edit section", () => { + test("has expected 'Meta'", async ({ organizationEditPage }) => { + const meta = organizationEditPage.page.getByTestId("gridContainer").getByTestId("grid").nth(2); + await expect(meta).toHaveText(organizationEditPage.getOrgMeta(MOCK_GET_ORGANIZATION_IGNORE)); + }); + + test("has expected 'Description'", async ({ organizationEditPage }) => { + await expect(organizationEditPage.page.getByTestId("description")).toHaveValue(MOCK_GET_ORGANIZATION_IGNORE.description); + }); + + test("has expected 'Jurisdiction'", async ({ organizationEditPage }) => { + await expect(organizationEditPage.page.getByTestId("jurisdiction")).toHaveValue(MOCK_GET_ORGANIZATION_IGNORE.jurisdiction); + }); + + test("has expected 'Filters'", async ({ organizationEditPage }) => { + await expect(organizationEditPage.page.getByTestId("filters")).toHaveValue(JSON.stringify(MOCK_GET_ORGANIZATION_IGNORE.filters, null, 2)); + }); + }); + + test.describe("'Preview save...'", () => { + test.beforeEach(async ({ organizationEditPage }) => { + await organizationEditPage.page + .getByRole("button", { + name: "Preview save...", + }) + .click(); + }); + + test("saves and closes modal", async ({ organizationEditPage }) => { + const modal = organizationEditPage.page.getByTestId("modalWindow").nth(0); + await expect(modal).toContainText(/You are about to change this setting: ignore/); + }); + + test("'Go back' closes modal'", async ({ organizationEditPage }) => { + const modal = organizationEditPage.page.getByTestId("modalWindow").nth(0); + await expect(modal).toBeVisible(); + + await organizationEditPage.page + .getByRole("button", { + name: "Go back", + }) + .click(); + await expect(modal).toBeHidden(); + }); + }); + + test.describe("'Organization Sender Settings' section", () => { + test("can create a new organization sender", async ({ organizationEditPage }) => { + await organizationEditPage.page + .locator('#orgsendersettings').getByRole('link', { name: 'New' }) + .click(); + await expect(organizationEditPage.page).toHaveURL(`/admin/orgnewsetting/org/ignore/settingtype/sender`); + await expect(organizationEditPage.page.getByText(/Org name: ignore/)).toBeVisible(); + await expect(organizationEditPage.page.getByText(/Setting Type: sender/)).toBeVisible(); + + await organizationEditPage.page.getByTestId("orgSettingName").fill("e2e-test"); + + await organizationEditPage.orgSenderNew.cancel.click(); + }); + + test("can edit an organization sender", async ({ organizationEditPage }) => { + const firstOrgSender = await organizationEditPage.page.locator("#orgsendersettings").nth(0).locator("td").nth(0).innerText(); + await organizationEditPage.page.locator('#orgsendersettings').getByRole('link', { name: 'Edit' }).nth(0).click(); + await expect(organizationEditPage.page).toHaveURL(`/admin/orgsendersettings/org/ignore/sender/${firstOrgSender}/action/edit`); + await expect(organizationEditPage.page.getByText(`Org name: ignore`)).toBeVisible(); + await expect(organizationEditPage.page.getByText(`Sender name: ${firstOrgSender}`)).toBeVisible(); + + await organizationEditPage.orgSenderEdit.editJsonButton.click(); + const modal = organizationEditPage.page.getByTestId("modalWindow").nth(0); + await expect(modal).toBeVisible(); + + // Save button is disabled + await expect(organizationEditPage.orgSenderEdit.editJsonModal.save).toHaveAttribute("disabled"); + + await organizationEditPage.orgSenderEdit.editJsonModal.checkSyntax.click(); + await expect(organizationEditPage.orgSenderEdit.editJsonModal.save).not.toHaveAttribute("disabled"); + + await organizationEditPage.orgSenderEdit.editJsonModal.save.click(); + await expect(modal).toBeHidden(); + + const orgSenderLocator = firstOrgSender.replace("-", "_"); + + await expect(organizationEditPage.page.locator(`#id_Item__${orgSenderLocator}__has_been_saved`).getByTestId("alerttoast")).toHaveText(`Item '${firstOrgSender}' has been saved`); + await expect(organizationEditPage.page).toHaveURL(organizationEditPage.url); + }); + + test("can cancel when editing an organization sender", async ({ organizationEditPage }) => { + const firstOrgSender = await tableDataCellValue(organizationEditPage.page, 0, 0); + await organizationEditPage.page. + locator('#orgsendersettings').getByRole('link', { name: 'Edit' }).nth(0).click(); + await expect(organizationEditPage.page).toHaveURL(`/admin/orgsendersettings/org/ignore/sender/${firstOrgSender}/action/edit`); + await expect(organizationEditPage.page.getByText(`Org name: ignore`)).toBeVisible(); + await expect(organizationEditPage.page.getByText(`Sender name: ${firstOrgSender}`)).toBeVisible(); + + await organizationEditPage.orgSenderEdit.cancelButton.click(); + await expect(organizationEditPage.page).toHaveURL(organizationEditPage.url); + }); + }); + + test.describe("'Organization Receiver Settings' section", () => { + test("can create a new organization receiver", async ({ organizationEditPage }) => { + await organizationEditPage.page + .locator('#orgreceiversettings').getByRole('link', { name: 'New' }) + .click(); + await expect(organizationEditPage.page).toHaveURL(`/admin/orgnewsetting/org/ignore/settingtype/receiver`); + await expect(organizationEditPage.page.getByText(/Org name: ignore/)).toBeVisible(); + await expect(organizationEditPage.page.getByText(/Setting Type: receiver/)).toBeVisible(); + + await organizationEditPage.page.getByTestId("orgSettingName").fill("e2e-test"); + + await organizationEditPage.orgReceiverNew.cancel.click(); + }); + + test("can edit an organization receiver", async ({ organizationEditPage }) => { + const firstOrgReceiver = await organizationEditPage.page.locator("#orgreceiversettings").nth(0).locator("td").nth(0).innerText(); + await organizationEditPage.page.locator('#orgreceiversettings').getByRole('link', { name: 'Edit' }).nth(0).click(); + await expect(organizationEditPage.page).toHaveURL(`/admin/orgreceiversettings/org/ignore/receiver/${firstOrgReceiver}/action/edit`); + await expect(organizationEditPage.page.getByText(`Org name: ignore`)).toBeVisible(); + await expect(organizationEditPage.page.getByText(`Receiver name: ${firstOrgReceiver}`)).toBeVisible(); + + await organizationEditPage.orgReceiverEdit.editJsonButton.click(); + const modal = organizationEditPage.page.getByTestId("modalWindow").nth(0); + await expect(modal).toBeVisible(); + + // Save button is disabled + await expect(organizationEditPage.orgReceiverEdit.editJsonModal.save).toHaveAttribute("disabled"); + + await organizationEditPage.orgReceiverEdit.editJsonModal.checkSyntax.click(); + await expect(organizationEditPage.orgReceiverEdit.editJsonModal.save).not.toHaveAttribute("disabled"); + + await organizationEditPage.orgReceiverEdit.editJsonModal.save.click(); + await expect(modal).toBeHidden(); + + const orgReceiverLocator = firstOrgReceiver.replace("-", "_"); + + await expect(organizationEditPage.page.locator(`#id_Item__${orgReceiverLocator}__has_been_updated`).getByTestId("alerttoast")).toHaveText(`Item '${firstOrgReceiver}' has been updated`); + await expect(organizationEditPage.page).toHaveURL(organizationEditPage.url); + }); + + test("can cancel when editing an organization receiver", async ({ organizationEditPage }) => { + const firstOrgReceiver = await organizationEditPage.page.locator("#orgreceiversettings").nth(0).locator("td").nth(0).innerText(); + await organizationEditPage.page.locator('#orgreceiversettings').getByRole('link', { name: 'Edit' }).nth(0).click(); + await expect(organizationEditPage.page).toHaveURL(`/admin/orgreceiversettings/org/ignore/receiver/${firstOrgReceiver}/action/edit`); + await expect(organizationEditPage.page.getByText(`Org name: ignore`)).toBeVisible(); + await expect(organizationEditPage.page.getByText(`Receiver name: ${firstOrgReceiver}`)).toBeVisible(); + + await organizationEditPage.orgReceiverEdit.cancelButton.click(); + await expect(organizationEditPage.page).toHaveURL(organizationEditPage.url); + }); + }); + }); + }); + + test.describe("footer", () => { + test("has footer and explicit scroll to footer and scroll to top", async ({ organizationEditPage }) => { + await organizationEditPage.testFooter(); + }); + }); +}); diff --git a/frontend-react/e2e/spec/all/authenticated/admin/organization-settings-page.spec.ts b/frontend-react/e2e/spec/all/authenticated/admin/organization-settings-page.spec.ts index ea405a97a83..70c8cf8079f 100644 --- a/frontend-react/e2e/spec/all/authenticated/admin/organization-settings-page.spec.ts +++ b/frontend-react/e2e/spec/all/authenticated/admin/organization-settings-page.spec.ts @@ -3,7 +3,7 @@ import { readFileSync } from "node:fs"; import { join } from "node:path"; import { fileURLToPath } from "node:url"; import { MOCK_GET_ORGANIZATION_SETTINGS_LIST } from "../../../../mocks/organizations"; -import { OrganizationPage } from "../../../../pages/authenticated/organization"; +import { OrganizationPage } from "../../../../pages/authenticated/admin/organization"; import { test as baseTest } from "../../../../test"; const __dirname = fileURLToPath(import.meta.url); @@ -43,41 +43,41 @@ const test = baseTest.extend({ test.describe("Admin Organization Settings Page", () => { test.describe("not authenticated", () => { - test("redirects to login", async ({organizationPage}) => { + test("redirects to login", async ({ organizationPage }) => { await expect(organizationPage.page).toHaveURL("/login"); }); }); - test.describe("authenticated receiver", () => { - test.use({storageState: "e2e/.auth/receiver.json"}); - test("returns Page Not Found", async ({organizationPage}) => { + test.describe("receiver user", () => { + test.use({ storageState: "e2e/.auth/receiver.json" }); + test("returns Page Not Found", async ({ organizationPage }) => { await expect(organizationPage.page).toHaveTitle(/Page Not Found/); }); }); - test.describe("authenticated sender", () => { - test.use({storageState: "e2e/.auth/sender.json"}); - test("returns Page Not Found", async ({organizationPage}) => { + test.describe("sender user", () => { + test.use({ storageState: "e2e/.auth/sender.json" }); + test("returns Page Not Found", async ({ organizationPage }) => { await expect(organizationPage.page).toHaveTitle(/Page Not Found/); }); }); - test.describe("authenticated admin", () => { - test.use({storageState: "e2e/.auth/admin.json"}); + test.describe("admin user", () => { + test.use({ storageState: "e2e/.auth/admin.json" }); - test.describe("Header", () => { - test("has correct title + heading", async ({organizationPage}) => { + test.describe("header", () => { + test("has correct title + heading", async ({ organizationPage }) => { await organizationPage.testHeader(); }); }); - test("If there is an error, the error is shown on the page", async ({organizationPage}) => { + test("if there is an error, the error is shown on the page", async ({ organizationPage }) => { organizationPage.mockError = true; await organizationPage.reload(); await expect(organizationPage.page.getByText("there was an error")).toBeVisible(); }); - test.describe("When there is no error", () => { + test.describe("when there is no error", () => { test("nav contains the 'Admin tools' dropdown with 'Organization Settings' option", async ({ organizationPage, }) => { @@ -96,12 +96,12 @@ test.describe("Admin Organization Settings Page", () => { await expect(organizationPage.page).toHaveURL("/admin/settings"); }); - test("Has correct title", async ({organizationPage}) => { + test("has correct title", async ({ organizationPage }) => { await expect(organizationPage.page).toHaveURL(/settings/); await expect(organizationPage.page).toHaveTitle(/Admin-Organizations/); }); - test("Displays data", async ({organizationPage}) => { + test("displays data", async ({ organizationPage }) => { // Heading with result length await expect( organizationPage.page.getByRole("heading", { @@ -122,7 +122,7 @@ test.describe("Admin Organization Settings Page", () => { const cols = await row.getByRole("cell").allTextContents(); expect(cols).toHaveLength(colHeaders.length); - const {description, jurisdiction, name, stateCode} = + const { description, jurisdiction, name, stateCode } = i === 0 ? MOCK_GET_ORGANIZATION_SETTINGS_LIST[0] : (MOCK_GET_ORGANIZATION_SETTINGS_LIST.find((i) => i.name === cols[0]) ?? { @@ -141,7 +141,7 @@ test.describe("Admin Organization Settings Page", () => { } }); - test("Create new organization navigation works", async ({organizationPage}) => { + test("create new organization navigation works", async ({ organizationPage }) => { const link = organizationPage.page.getByRole("link", { name: "Create New Organization", }); @@ -155,7 +155,7 @@ test.describe("Admin Organization Settings Page", () => { expect(organizationPage.page.url()).toContain(expectedUrl); }); - test("Save CSV button downloads a file", async ({organizationPage}) => { + test("save CSV button downloads a file", async ({ organizationPage }) => { const downloadProm = organizationPage.page.waitForEvent("download"); const saveButton = organizationPage.page.getByRole("button", { name: "Save List to CSV", @@ -174,9 +174,9 @@ test.describe("Admin Organization Settings Page", () => { expect(download.suggestedFilename()).toBe("prime-orgs.csv"); }); - test("Filtering works", async ({organizationPage}) => { + test("filtering works", async ({ organizationPage }) => { const table = organizationPage.page.getByRole("table"); - const {description, name, jurisdiction, stateCode} = MOCK_GET_ORGANIZATION_SETTINGS_LIST[2]; + const { description, name, jurisdiction, stateCode } = MOCK_GET_ORGANIZATION_SETTINGS_LIST[2]; const filterBox = organizationPage.page.getByRole("textbox", { name: "Filter:", }); @@ -201,7 +201,7 @@ test.describe("Admin Organization Settings Page", () => { } }); - test('Clicking "Set" updates link label', async ({organizationPage}) => { + test('clicking "Set" updates link label', async ({ organizationPage }) => { const firstDataRow = organizationPage.page.getByRole("table").getByRole("row").nth(1); const firstDataRowName = (await firstDataRow.getByRole("cell").nth(0).textContent()) ?? "INVALID"; const setButton = firstDataRow.getByRole("button", { @@ -218,9 +218,9 @@ test.describe("Admin Organization Settings Page", () => { await expect(orgLink).toHaveAttribute("href", "/admin/settings"); }); - test("Edit navigation works", async ({organizationPage}) => { + test("edit navigation works", async ({ organizationPage }) => { const firstDataRow = organizationPage.page.getByRole("table").getByRole("row").nth(1); - const firstDataRowName = await firstDataRow.getByRole("cell").nth(0).textContent(); + const firstDataRowName = (await firstDataRow.getByRole("cell").nth(0).textContent()) ?? "INVALID"; const expectedUrl = `/admin/orgsettings/org/${firstDataRowName}`; const editButton = firstDataRow.getByRole("button", { name: "Edit", @@ -229,15 +229,15 @@ test.describe("Admin Organization Settings Page", () => { await expect(editButton).toBeVisible(); await editButton.click(); await organizationPage.page.waitForURL(expectedUrl); - await expect(organizationPage.page.getByRole("heading")).toBeVisible(); + expect(organizationPage.page.locator("h2").getByText(firstDataRowName)).toBeTruthy(); expect(organizationPage.page.url()).toContain(expectedUrl); }); }); }); - test.describe("Footer", () => { - test("has footer and explicit scroll to footer and scroll to top", async ({organizationPage}) => { + test.describe("footer", () => { + test("has footer and explicit scroll to footer and scroll to top", async ({ organizationPage }) => { await organizationPage.testFooter(); }); }); diff --git a/frontend-react/e2e/spec/all/idletimeout.spec.ts b/frontend-react/e2e/spec/all/idletimeout.spec.ts index 0b35f0fd34d..cc42f98b4d9 100644 --- a/frontend-react/e2e/spec/all/idletimeout.spec.ts +++ b/frontend-react/e2e/spec/all/idletimeout.spec.ts @@ -1,7 +1,7 @@ import { expect } from "@playwright/test"; import process from "node:process"; -import { OrganizationPage } from "../../pages/authenticated/organization"; +import { OrganizationPage } from "../../pages/authenticated/admin/organization"; import { test as baseTest } from "../../test"; const timeout = parseInt(process.env.VITE_IDLE_TIMEOUT ?? "20000"); diff --git a/frontend-react/e2e/spec/chromium-only/authenticated/last-mile-failures-page-user-flow.spec.ts b/frontend-react/e2e/spec/chromium-only/authenticated/last-mile-failures-page-user-flow.spec.ts index e1a09504f79..6e4baa74876 100644 --- a/frontend-react/e2e/spec/chromium-only/authenticated/last-mile-failures-page-user-flow.spec.ts +++ b/frontend-react/e2e/spec/chromium-only/authenticated/last-mile-failures-page-user-flow.spec.ts @@ -1,5 +1,5 @@ import { tableRows } from "../../../helpers/utils"; -import { LastMileFailuresPage } from "../../../pages/authenticated/last-mile-failures"; +import { LastMileFailuresPage } from "../../../pages/authenticated/admin/last-mile-failures"; import { test as baseTest, expect } from "../../../test"; export interface LastMileFailuresPageFixtures { @@ -87,10 +87,12 @@ test.describe("Last Mile Failure page", test.skip(!isMockDisabled, "Mocks are ENABLED, skipping test"); const receiver = tableRows(lastMileFailuresPage.page).nth(0).locator("td").nth(2); const receiverCell = await receiver.getByRole("link").innerText(); + const orgName = receiverCell.slice(0,receiverCell.indexOf(".")) + const receiverName = receiverCell.slice(receiverCell.indexOf(".") + 1) await receiver.click(); await expect(lastMileFailuresPage.page).toHaveURL( - `/admin/orgreceiversettings/org/${receiverCell}/receiver//action/edit`, + `/admin/orgreceiversettings/org/${orgName}/receiver/${receiverName}/action/edit`, ); }); }); diff --git a/frontend-react/e2e/spec/chromium-only/authenticated/organization-settings-page-user-flow.spec.ts b/frontend-react/e2e/spec/chromium-only/authenticated/organization-settings-page-user-flow.spec.ts index fa74fc13713..0cd6327d074 100644 --- a/frontend-react/e2e/spec/chromium-only/authenticated/organization-settings-page-user-flow.spec.ts +++ b/frontend-react/e2e/spec/chromium-only/authenticated/organization-settings-page-user-flow.spec.ts @@ -1,7 +1,7 @@ import { expect } from "@playwright/test"; import { tableRows } from "../../../helpers/utils"; import { MOCK_GET_ORGANIZATION_SETTINGS_LIST } from "../../../mocks/organizations"; -import { OrganizationPage } from "../../../pages/authenticated/organization"; +import { OrganizationPage } from "../../../pages/authenticated/admin/organization"; import { test as baseTest } from "../../../test"; diff --git a/frontend-react/src/components/Admin/CompareJsonModal.tsx b/frontend-react/src/components/Admin/CompareJsonModal.tsx index 87b456d9e66..d68fe7d4cd5 100644 --- a/frontend-react/src/components/Admin/CompareJsonModal.tsx +++ b/frontend-react/src/components/Admin/CompareJsonModal.tsx @@ -169,6 +169,7 @@ export const ConfirmSaveSettingModal = forwardRef( aria-label="Check the settings JSON syntax" key={`${uniquid}-validate-button`} data-uniquid={uniquid} + data-testid={"editCheckSyntaxButton"} onClick={onCheckSyntaxClick} type="button" > From 30a1b2ee24c77dc621fb251f9b9fac6318c8a2c7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Sep 2024 13:35:09 -0400 Subject: [PATCH 2/3] Bump bridgecrewio/checkov-action from 12.2871.0 to 12.2873.0 (#15912) * Bump bridgecrewio/checkov-action from 12.2871.0 to 12.2873.0 Bumps [bridgecrewio/checkov-action](https://github.com/bridgecrewio/checkov-action) from 12.2871.0 to 12.2873.0. - [Release notes](https://github.com/bridgecrewio/checkov-action/releases) - [Commits](https://github.com/bridgecrewio/checkov-action/compare/15c964c5bee933376cc576908ccfad6687718c8e...d0e41abbcc8c1103c6ae7e451681d071f05e1c20) --- updated-dependencies: - dependency-name: bridgecrewio/checkov-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * add local_user_enabled = false * remove from sftp and ignore --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: nesm Co-authored-by: Stephen Nesman <94193373+snesm@users.noreply.github.com> --- .github/workflows/validate_terraform.yml | 4 ++-- operations/app/terraform/modules/storage/candidate_slot.tf | 2 ++ operations/app/terraform/modules/storage/main.tf | 3 +++ operations/app/terraform/modules/storage/trial_frontends.tf | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate_terraform.yml b/.github/workflows/validate_terraform.yml index 0f5e50e6a91..6fa0c54c997 100644 --- a/.github/workflows/validate_terraform.yml +++ b/.github/workflows/validate_terraform.yml @@ -48,7 +48,7 @@ jobs: uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - name: Run Checkov action - uses: bridgecrewio/checkov-action@15c964c5bee933376cc576908ccfad6687718c8e + uses: bridgecrewio/checkov-action@d0e41abbcc8c1103c6ae7e451681d071f05e1c20 with: directory: operations/app/terraform - skip_check: CKV_AZURE_139,CKV_AZURE_137,CKV_AZURE_103,CKV_AZURE_104,CKV_AZURE_102,CKV_AZURE_130,CKV_AZURE_121,CKV_AZURE_67,CKV_AZURE_56,CKV_AZURE_17,CKV_AZURE_63,CKV_AZURE_18,CKV_AZURE_88,CKV_AZURE_65,CKV_AZURE_13,CKV_AZURE_66,CKV_AZURE_33,CKV_AZURE_35,CKV_AZURE_36,CKV_AZURE_98,CKV2_AZURE_1,CKV2_AZURE_15,CKV2_AZURE_21,CKV_AZURE_213,CKV_AZURE_59,CKV2_AZURE_33,CKV2_AZURE_32,CKV2_AZURE_28,CKV_AZURE_206,CKV_AZURE_42,CKV_AZURE_110,CKV_AZURE_109,CKV_AZURE_166,CKV2_AZURE_38,CKV2_AZURE_40,CKV2_AZURE_41,CKV_AZURE_235 + skip_check: CKV_AZURE_139,CKV_AZURE_137,CKV_AZURE_103,CKV_AZURE_104,CKV_AZURE_102,CKV_AZURE_130,CKV_AZURE_121,CKV_AZURE_67,CKV_AZURE_56,CKV_AZURE_17,CKV_AZURE_63,CKV_AZURE_18,CKV_AZURE_88,CKV_AZURE_65,CKV_AZURE_13,CKV_AZURE_66,CKV_AZURE_33,CKV_AZURE_35,CKV_AZURE_36,CKV_AZURE_98,CKV2_AZURE_1,CKV2_AZURE_15,CKV2_AZURE_21,CKV_AZURE_213,CKV_AZURE_59,CKV2_AZURE_33,CKV2_AZURE_32,CKV2_AZURE_28,CKV_AZURE_206,CKV_AZURE_42,CKV_AZURE_110,CKV_AZURE_109,CKV_AZURE_166,CKV2_AZURE_38,CKV2_AZURE_40,CKV2_AZURE_41,CKV_AZURE_235,CKV_AZURE_244 diff --git a/operations/app/terraform/modules/storage/candidate_slot.tf b/operations/app/terraform/modules/storage/candidate_slot.tf index 68c12afbf8b..6fa9feadd23 100644 --- a/operations/app/terraform/modules/storage/candidate_slot.tf +++ b/operations/app/terraform/modules/storage/candidate_slot.tf @@ -9,6 +9,7 @@ resource "azurerm_storage_account" "storage_account_candidate" { min_tls_version = "TLS1_2" allow_nested_items_to_be_public = false enable_https_traffic_only = true + local_user_enabled = false network_rules { default_action = var.is_temp_env == true ? "Allow" : "Deny" @@ -155,6 +156,7 @@ resource "azurerm_storage_account" "storage_partner_candidate" { min_tls_version = "TLS1_2" allow_nested_items_to_be_public = false enable_https_traffic_only = true + local_user_enabled = false network_rules { default_action = var.is_temp_env == true ? "Allow" : "Deny" diff --git a/operations/app/terraform/modules/storage/main.tf b/operations/app/terraform/modules/storage/main.tf index 2d2414ada35..8ad6e5456e2 100644 --- a/operations/app/terraform/modules/storage/main.tf +++ b/operations/app/terraform/modules/storage/main.tf @@ -9,6 +9,7 @@ resource "azurerm_storage_account" "storage_account" { min_tls_version = "TLS1_2" allow_nested_items_to_be_public = false enable_https_traffic_only = true + local_user_enabled = false network_rules { default_action = var.is_temp_env == true ? "Allow" : "Deny" @@ -166,6 +167,7 @@ resource "azurerm_storage_account" "storage_public" { min_tls_version = "TLS1_2" allow_nested_items_to_be_public = false enable_https_traffic_only = true + local_user_enabled = false static_website { index_document = "index.html" @@ -208,6 +210,7 @@ resource "azurerm_storage_account" "storage_partner" { min_tls_version = "TLS1_2" allow_nested_items_to_be_public = false enable_https_traffic_only = true + local_user_enabled = false network_rules { default_action = var.is_temp_env == true ? "Allow" : "Deny" diff --git a/operations/app/terraform/modules/storage/trial_frontends.tf b/operations/app/terraform/modules/storage/trial_frontends.tf index f5ca92fe474..0ff68c67d35 100644 --- a/operations/app/terraform/modules/storage/trial_frontends.tf +++ b/operations/app/terraform/modules/storage/trial_frontends.tf @@ -10,6 +10,7 @@ resource "azurerm_storage_account" "storage_trials" { min_tls_version = "TLS1_2" allow_nested_items_to_be_public = false enable_https_traffic_only = true + local_user_enabled = false static_website { index_document = "index.html" From fe66c64e85771c6ea61b8205733dcf009631ddd5 Mon Sep 17 00:00:00 2001 From: Stephen Nesman <94193373+snesm@users.noreply.github.com> Date: Fri, 20 Sep 2024 13:36:11 -0400 Subject: [PATCH 3/3] add /auth to dependabot (#15935) --- .github/dependabot.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e96977a7103..8bc1de5d19f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -324,6 +324,17 @@ updates: timezone: "US/Eastern" rebase-strategy: "disabled" + # auth + - package-ecosystem: "gradle" + directory: "/auth" + open-pull-requests-limit: 100 + schedule: + interval: "weekly" + day: "sunday" + time: "04:17" + timezone: "US/Eastern" + rebase-strategy: "disabled" + # Backend - package-ecosystem: "gradle" directory: "/prime-router"