Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sonar plugin update test #6774

Closed
wants to merge 78 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
176b2d9
update sonar dependencies to be compatible with gradle 8
zdeveloper Oct 18, 2023
88e0f45
update sonar config
zdeveloper Oct 18, 2023
b89cfde
Use storysource addon
mpbrown Aug 14, 2023
1bfac57
Initial TestQueueCard
mpbrown Aug 14, 2023
4c2c3ef
Refactor test card and form
mpbrown Aug 30, 2023
df07aee
Use TestCard.scss
mpbrown Aug 30, 2023
9922228
Change accordion to collapsible card
mpbrown Sep 5, 2023
6c56822
Add Covid AoE form
mpbrown Sep 5, 2023
6c936de
Update symptoms and save form edits
mpbrown Sep 7, 2023
ac5f3ca
Add submit and validation
mpbrown Sep 11, 2023
73084bd
Update card styling
mpbrown Sep 13, 2023
77b1e23
Revert demo changes to single card
mpbrown Sep 15, 2023
252913a
Add test date and time validation style
mpbrown Sep 15, 2023
1657d2f
Update test result radio group style
mpbrown Sep 15, 2023
d013699
Update card styling, add submit loader, correction alert
mpbrown Sep 18, 2023
b2a4520
Update timer styling
mpbrown Sep 18, 2023
1bfde30
Fix lint warnings in timer
mpbrown Sep 18, 2023
16caa10
Revert timer and close button style change
mpbrown Sep 19, 2023
cecfece
Fix error summary display logic
mpbrown Sep 19, 2023
49f5a55
Add unordered list for error summary
mpbrown Sep 19, 2023
ef1adc6
Add submit modal
mpbrown Sep 19, 2023
f3c8b99
Update CovidAoEForm and check if completed
mpbrown Sep 20, 2023
82f8970
Add testCardRefactorEnabled feature flag
mpbrown Sep 20, 2023
43bb334
Start test without AOE modal
mpbrown Sep 20, 2023
80d3ab7
Revert explicit null aoe fields
mpbrown Sep 25, 2023
8d9e95b
Organize disease specific components
mpbrown Sep 25, 2023
c1d2d03
Remove from queue and fix adding from manage patients
mpbrown Sep 25, 2023
55135d7
Fix active patient added again after submit
mpbrown Sep 25, 2023
e01bdda
Save AOE responses
mpbrown Sep 25, 2023
924830a
Reposition close button
mpbrown Sep 25, 2023
5a2d6a9
Update test timer design
mpbrown Sep 25, 2023
7e2704d
Cleanup and refactor
mpbrown Sep 25, 2023
ef29040
Fix dirty state update and test results comparison
mpbrown Sep 27, 2023
995fd62
Update validation messages
mpbrown Sep 27, 2023
fab9344
Update tests with timer changes
mpbrown Sep 27, 2023
3f23f59
Move files and use feature flag on submit loader
mpbrown Sep 27, 2023
8bc32a2
Add required asterisks
mpbrown Sep 27, 2023
b467b61
Prevent patient re-add after page refresh
mpbrown Sep 27, 2023
dd40b0e
Fix fade out transition on test card
mpbrown Sep 27, 2023
1ffbd3e
Check for active mutations before updates from backend
mpbrown Sep 27, 2023
940033e
Remove useMemo on options hooks with complex object dependencies
mpbrown Sep 27, 2023
5b979d3
WIP test card frontend tests
mpbrown Sep 27, 2023
bfa3216
Scroll to active patient and update test
mpbrown Sep 28, 2023
a6abe22
Update test snapshots for new timer
mpbrown Sep 28, 2023
dc36fed
Update test for handling deleted device
mpbrown Sep 28, 2023
5d5d347
Revert "Use storysource addon"
mpbrown Sep 28, 2023
60f2d6d
Fix eslint import order
mpbrown Sep 28, 2023
aef712b
fix snap
zdeveloper Oct 2, 2023
e72b67d
fixed frontend test and fixed crash when sysmptomOnSet date was set
zdeveloper Oct 5, 2023
15df80c
update snapshots
zdeveloper Oct 5, 2023
bf05ae9
fix linting
zdeveloper Oct 5, 2023
091e97b
address sonar feedback
zdeveloper Oct 5, 2023
bcbeec0
follow up fix
zdeveloper Oct 5, 2023
15e6f67
add MultiplexResultInputGroup tests
zdeveloper Oct 10, 2023
6088add
add CovidResultInputGroup tests
zdeveloper Oct 10, 2023
3499759
clean console.log
zdeveloper Oct 10, 2023
1e08da5
refactor all userEvents to use the user.setup object in testcard.test…
zdeveloper Oct 10, 2023
27ab933
added more test coverage
zdeveloper Oct 10, 2023
8cc7c57
Hide AOE for flu only devices
mpbrown Oct 11, 2023
5fc34b2
disable new test card in e2e and improve testing
zdeveloper Oct 11, 2023
d501c64
turn off new test card in stg demo training and e2e
zdeveloper Oct 11, 2023
50edec1
more direct ignore coverage
zdeveloper Oct 11, 2023
f75a872
update snapshot
zdeveloper Oct 11, 2023
7372cde
add more coverage and fix error message logic
zdeveloper Oct 12, 2023
a094a1f
add more test coverage
zdeveloper Oct 12, 2023
dc0bcda
update snaps
zdeveloper Oct 12, 2023
9c0e015
Revert storybook react-docgen config
mpbrown Oct 13, 2023
b3f9af4
Cleanup comments and unused variables
mpbrown Oct 13, 2023
1363972
Move modals to individual files
mpbrown Oct 13, 2023
8c3345f
Use covid AOE for devices w/o disease info
mpbrown Oct 16, 2023
3eb8525
Fix AOE symptoms boolean quote bug
mpbrown Oct 16, 2023
b0edc41
Fix track AOE test and snapshots
mpbrown Oct 17, 2023
d4a1303
Fix check if AOE answers completed
mpbrown Oct 17, 2023
51008ba
Update snapshot
mpbrown Oct 17, 2023
0328885
Update test to use async find instead of get
mpbrown Oct 17, 2023
f0fd01c
Enable test card refactor in training
mpbrown Oct 18, 2023
ae3b5d0
set fixed date for now on test-queue test
zdeveloper Oct 18, 2023
4dfb9cc
add bogus code for coverage test
zdeveloper Oct 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
id 'java'
id 'checkstyle'
id 'jacoco'
id 'org.sonarqube' version '4.0.0.2929'
id 'org.sonarqube' version '4.4.1.3373'
id 'com.gorylenko.gradle-git-properties' version '2.4.1'
id "com.diffplug.spotless" version "6.22.0"
}
Expand Down Expand Up @@ -198,7 +198,7 @@ liquibase {
}
}

sonarqube {
sonar {
properties {
property "sonar.projectKey", "CDCgov_prime-data-input-client"
property "sonar.organization", "cdcgov"
Expand All @@ -209,6 +209,7 @@ sonarqube {
property "sonar.coverage.exclusions", "frontend/src/setupTests.js,frontend/src/index.tsx"
property "sonar.cpd.exclusions", "frontend/src/lang/*.ts"
property "sonar.javascript.lcov.reportPaths", "frontend/coverage/lcov.info,ops/services/app_functions/report_stream_batched_publisher/functions/coverage/lcov.info"
property "sonar.gradle.skipCompile", "false"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ public class BulkUploadResultsToFhir {
}

public List<String> convertToFhirBundles(InputStream csvStream, UUID orgId) {

if (orgId == null) {
System.out.println("I WAS NOT COVERED IN TEST");
for (int i = 0; i < 10; i++) {
System.out.println("counting " + i);
}
}

var futureTestEvents = new ArrayList<CompletableFuture<String>>();
final MappingIterator<Map<String, String>> valueIterator = getIteratorForCsv(csvStream);
while (valueIterator.hasNext()) {
Expand Down
2 changes: 2 additions & 0 deletions backend/src/main/resources/application-azure-demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ simple-report:
- https://demo.simplereport.gov
twilio:
enabled: false
features:
testCardRefactorEnabled: false
2 changes: 2 additions & 0 deletions backend/src/main/resources/application-azure-stg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ simple-report:
- https://stg.simplereport.gov
experian:
enabled: true
features:
testCardRefactorEnabled: false
2 changes: 2 additions & 0 deletions backend/src/main/resources/application-azure-training.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ simple-report:
- https://training.simplereport.gov
twilio:
enabled: false
features:
testCardRefactorEnabled: true
4 changes: 3 additions & 1 deletion backend/src/main/resources/application-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,6 @@ simple-report-initialization:
test-ordered-loinc-code: "94558-4"
datahub:
url: "http://invalidhost:8080"
api-key: "placeholder"
api-key: "placeholder"
features:
testCardRefactorEnabled: false
1 change: 0 additions & 1 deletion frontend/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const { resolve } = require("path");
module.exports = {
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: [
Expand Down
4 changes: 3 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@
"coveragePathIgnorePatterns": [
"<rootDir>/src/index.tsx",
"<rootDir>/src/serviceWorker.ts",
".stories.tsx"
".stories.tsx",
"<rootDir>/src/app/testQueue/constants.ts",
"<rootDir>/src/patientApp/timeOfTest/constants.ts"
]
}
}
3 changes: 2 additions & 1 deletion frontend/src/app/commonComponents/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export const TextInput = ({
labelClassName
)}
htmlFor={id}
id={`label-for-${id}`}
aria-describedby={ariaDescribedBy}
>
{required ? <Required label={label} /> : <Optional label={label} />}
Expand All @@ -112,7 +113,6 @@ export const TextInput = ({
"usa-input",
validationStatus === "error" && "usa-input--error"
)}
id={id}
data-testid={idString}
name={name}
value={value || ""}
Expand All @@ -135,6 +135,7 @@ export const TextInput = ({
? { "aria-describedby": `error_${id}`, "aria-invalid": true }
: null)}
{...registrationProps}
id={id}
/>
</div>
)}
Expand Down
26 changes: 10 additions & 16 deletions frontend/src/app/commonComponents/YesNoRadioGroup.test.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { render, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";

import YesNoRadioGroup, {
boolToYesNoUnknown,
yesNoUnknownToBool,
} from "./YesNoRadioGroup";
import YesNoRadioGroup, { boolToYesNo, yesNoToBool } from "./YesNoRadioGroup";

describe("Yes/No/Unknown RadioGroup", () => {
describe("Yes/No RadioGroup", () => {
const onChangeFn = jest.fn(() => {});
const onBlurFn = jest.fn(() => {});

Expand Down Expand Up @@ -41,8 +38,6 @@ describe("Yes/No/Unknown RadioGroup", () => {
expect(onChangeFn).toHaveBeenCalledWith("YES");
await userEvent.click(screen.getByLabelText("No"));
expect(onChangeFn).toHaveBeenCalledWith("NO");
await userEvent.click(screen.getByLabelText("Unknown"));
expect(onChangeFn).toHaveBeenCalledWith("UNKNOWN");
});

it("calls function on blur", async () => {
Expand All @@ -53,19 +48,18 @@ describe("Yes/No/Unknown RadioGroup", () => {
expect(onBlurFn).toHaveBeenCalled();
});

describe("Yes/No/Unknown utility methods", () => {
describe("Yes/No utility methods", () => {
it("converts value to bool", () => {
expect(yesNoUnknownToBool("YES")).toBeTruthy();
expect(yesNoUnknownToBool("NO")).toBeFalsy();
expect(yesNoUnknownToBool("UNKNOWN")).toBeNull();
expect(yesNoToBool("YES")).toBeTruthy();
expect(yesNoToBool("NO")).toBeFalsy();
// @ts-ignore
expect(yesNoUnknownToBool(undefined)).toBeUndefined();
expect(yesNoToBool(undefined)).toBeUndefined();
});
it("converts bool to value", () => {
expect(boolToYesNoUnknown(true)).toBe("YES");
expect(boolToYesNoUnknown(false)).toBe("NO");
expect(boolToYesNoUnknown(null)).toBe("UNKNOWN");
expect(boolToYesNoUnknown(undefined)).toBeUndefined();
expect(boolToYesNo(true)).toBe("YES");
expect(boolToYesNo(false)).toBe("NO");
expect(boolToYesNo(null)).toBeUndefined();
expect(boolToYesNo(undefined)).toBeUndefined();
});
});
});
20 changes: 6 additions & 14 deletions frontend/src/app/commonComponents/YesNoRadioGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,33 @@ import { useTranslatedConstants } from "../constants";

import RadioGroup from "./RadioGroup";

export const boolToYesNoUnknown = (
export const boolToYesNo = (
value: boolean | null | undefined
): YesNoUnknown | undefined => {
): YesNo | undefined => {
if (value) {
return "YES";
}
if (value === false) {
return "NO";
}
if (value === null) {
return "UNKNOWN";
}
return undefined;
};

export const yesNoUnknownToBool = (
value: YesNoUnknown
): boolean | null | undefined => {
export const yesNoToBool = (value: YesNo): boolean | undefined => {
if (value === "YES") {
return true;
}
if (value === "NO") {
return false;
}
if (value === "UNKNOWN") {
return null;
}
return undefined;
};

interface Props {
name: string;
legend: React.ReactNode;
value: YesNoUnknown | undefined;
onChange: (value: YesNoUnknown) => void;
value: YesNo | undefined;
onChange: (value: YesNo) => void;
hintText?: string;
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
validationStatus?: "error" | "success";
Expand All @@ -57,7 +49,7 @@ const YesNoRadioGroup: React.FC<Props> = ({
errorMessage,
required,
}) => {
const { YES_NO_UNKNOWN_VALUES: values } = useTranslatedConstants();
const { YES_NO_VALUES: values } = useTranslatedConstants();

return (
<RadioGroup
Expand Down
10 changes: 10 additions & 0 deletions frontend/src/app/patients/__snapshots__/EditPatient.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ exports[`EditPatient facility select input matches screenshot 1`] = `
<label
class="usa-label"
for="103"
id="label-for-103"
>
First name
<abbr
Expand All @@ -129,6 +130,7 @@ exports[`EditPatient facility select input matches screenshot 1`] = `
<label
class="usa-label"
for="104"
id="label-for-104"
>
Middle name
</label>
Expand All @@ -148,6 +150,7 @@ exports[`EditPatient facility select input matches screenshot 1`] = `
<label
class="usa-label"
for="105"
id="label-for-105"
>
Last name
<abbr
Expand Down Expand Up @@ -1922,6 +1925,7 @@ exports[`EditPatient facility select input matches screenshot 1`] = `
<label
class="usa-label"
for="108"
id="label-for-108"
>
Date of birth (mm/dd/yyyy)
<abbr
Expand Down Expand Up @@ -2000,6 +2004,7 @@ exports[`EditPatient facility select input matches screenshot 1`] = `
<label
class="usa-label"
for="109"
id="label-for-109"
>
Primary phone number
<abbr
Expand Down Expand Up @@ -2191,6 +2196,7 @@ exports[`EditPatient facility select input matches screenshot 1`] = `
<label
class="usa-label"
for="112"
id="label-for-112"
>
Email address
</label>
Expand Down Expand Up @@ -3920,6 +3926,7 @@ exports[`EditPatient facility select input matches screenshot 1`] = `
<label
class="usa-label"
for="115"
id="label-for-115"
>
Street address 1
<abbr
Expand Down Expand Up @@ -3949,6 +3956,7 @@ exports[`EditPatient facility select input matches screenshot 1`] = `
<label
class="usa-label"
for="116"
id="label-for-116"
>
Street address 2
</label>
Expand All @@ -3971,6 +3979,7 @@ exports[`EditPatient facility select input matches screenshot 1`] = `
<label
class="usa-label"
for="117"
id="label-for-117"
>
City
<abbr
Expand All @@ -3996,6 +4005,7 @@ exports[`EditPatient facility select input matches screenshot 1`] = `
<label
class="usa-label"
for="118"
id="label-for-118"
>
County
</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ exports[`update existing devices renders the Device Form 1`] = `
<label
class="usa-label"
for="41"
id="label-for-41"
>
Device Name
<abbr
Expand Down Expand Up @@ -328,6 +329,7 @@ exports[`update existing devices renders the Device Form 1`] = `
<label
class="usa-label"
for="42"
id="label-for-42"
>
Model
<abbr
Expand Down Expand Up @@ -363,6 +365,7 @@ exports[`update existing devices renders the Device Form 1`] = `
<label
class="usa-label"
for="43"
id="label-for-43"
>
Manufacturer
<abbr
Expand Down Expand Up @@ -398,6 +401,7 @@ exports[`update existing devices renders the Device Form 1`] = `
<label
class="usa-label"
for="44"
id="label-for-44"
>
Test length (minutes)
<abbr
Expand Down Expand Up @@ -617,6 +621,7 @@ exports[`update existing devices renders the Device Form 1`] = `
<label
class="usa-label"
for="47"
id="label-for-47"
>
Test performed code
<abbr
Expand Down Expand Up @@ -648,6 +653,7 @@ exports[`update existing devices renders the Device Form 1`] = `
<label
class="usa-label"
for="48"
id="label-for-48"
>
Test ordered code
<abbr
Expand Down Expand Up @@ -679,6 +685,7 @@ exports[`update existing devices renders the Device Form 1`] = `
<label
class="usa-label"
for="49"
id="label-for-49"
>
Testkit Name Id
</label>
Expand All @@ -703,6 +710,7 @@ exports[`update existing devices renders the Device Form 1`] = `
<label
class="usa-label"
for="50"
id="label-for-50"
>
Equipment Uid
</label>
Expand Down
Loading
Loading