Skip to content

Commit

Permalink
Merge branch 'main' of github.com:hivtools/hint into nm-84
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Kusumgar committed Nov 20, 2024
2 parents 1be259e + c9dd95c commit 5d86fa6
Show file tree
Hide file tree
Showing 50 changed files with 55,296 additions and 35,162 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class BaselineTests : VersionFileTests()
authorize()
testRestTemplate.getForEntity<String>("/")

val postEntity = getTestEntity("Malawi2019.PJNZ")
val postEntity = getTestEntity("Malawi2024.PJNZ")
testRestTemplate.postForEntity<String>("/baseline/pjnz/", postEntity)

val postShapeEntity = getTestEntity("malawi.geojson")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ChartDataTests : SecureIntegrationTests()
testRestTemplate.getForEntity<String>("/")
val shapePostEntity = getTestEntity("malawi.geojson")
testRestTemplate.postForEntity<String>("/baseline/shape/", shapePostEntity)
val pjnzPostEntity = getTestEntity("Malawi2019.PJNZ")
val pjnzPostEntity = getTestEntity("Malawi2024.PJNZ")
testRestTemplate.postForEntity<String>("/baseline/pjnz/", pjnzPostEntity)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class DiseaseTests : VersionFileTests()
authorize()
testRestTemplate.getForEntity<String>("/")
testRestTemplate.postForEntity<String>("/baseline/pjnz/",
getTestEntity("Malawi2019.PJNZ"))
getTestEntity("Malawi2024.PJNZ"))
testRestTemplate.postForEntity<String>("/baseline/shape/",
getTestEntity("malawi.geojson"))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ abstract class SecureIntegrationTests : CleanDatabaseTests()
getTestEntity("malawi.geojson"))

testRestTemplate.postForEntity<String>("/baseline/pjnz/",
getTestEntity("Malawi2019.PJNZ"))
getTestEntity("Malawi2024.PJNZ"))

testRestTemplate.postForEntity<String>("/baseline/population/",
getTestEntity("population.csv"))
Expand Down Expand Up @@ -299,16 +299,18 @@ abstract class SecureIntegrationTests : CleanDatabaseTests()

fun getMockModelOptions(): Map<String, Any>
{
return mapOf("anc_art_coverage_year1" to "2018",
"anc_prevalence_year1" to "2018",
"anc_prevalence_year2" to "2018",
return mapOf("anc_art_coverage_year1" to "2023",
"anc_prevalence_year1" to "2023",
"anc_prevalence_year2" to "2023",
"area_level" to "4", "area_scope" to "MWI",
"artattend" to "false",
"artattend_log_gamma_offset" to -4,
"artattend_t2" to "true",
"calendar_quarter_t1" to "CY2018Q3",
"calendar_quarter_t2" to "CY2019Q4",
"calendar_quarter_t3" to "CY2020Q3",
"calendar_quarter_t1" to "CY2020Q3",
"calendar_quarter_t2" to "CY2023Q4",
"calendar_quarter_t3" to "CY2024Q3",
"calendar_quarter_t4" to "CY2025Q3",
"calendar_quarter_t5" to "CY2026Q3",
"deff_artcov" to 1,
"deff_prev" to 1,
"deff_recent" to 1,
Expand All @@ -318,11 +320,11 @@ abstract class SecureIntegrationTests : CleanDatabaseTests()
"no_of_samples" to 1000,
"permissive" to "false",
"rng_seed" to 28,
"survey_art_coverage" to { "MWI2016PHIA" },
"survey_prevalence" to { "MWI2016PHIA" },
"survey_recently_infected" to { "MWI2016PHIA" },
"survey_art_coverage" to { "DEMO2020PHIA" },
"survey_prevalence" to { "DEMO2020PHIA" },
"survey_recently_infected" to { "DEMO2020PHIA" },
"output_aware_plhiv" to "true",
"anc_clients_year2" to 2018,
"anc_clients_year2" to 2023,
"anc_clients_year2_num_months" to "9")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class RehydrateTests: SecureIntegrationTests()
val resultBody = ObjectMapper().readTree(responseEntity.body)
val errors = resultBody["errors"] as ArrayNode
assertThat(errors.count()).isEqualTo(1)
assertThat(errors[0]["detail"].asText()).isEqualTo("Cannot load from this zip file," +
" archive missing required information. Please regenerate output zip and try again.")
assertThat(errors[0]["detail"].asText()).isEqualTo("Cannot load model outputs. " +
"This fit was not generated on the Naomi web application. Please contact support.")
}

fun submitOutputResponse(): ResponseEntity<String>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion src/app/static/src/tests/e2e/outputPlots.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@ test("can view output plots", async ({ projectPage }) => {

// When I switch to barchart tab
await page.getByText('Bar').click();
// This can take a little while to redraw the error bars, so give it a second
await page.waitForTimeout(500);

// barchart is rendered as expected
await expect(page.locator("#review-output")).toHaveScreenshot("barchart-landing.png");

// When I update barchart x-axis plot control
await page.getByRole('button', { name: 'Age' }).click();
await page.locator('a').filter({ hasText: 'Area' }).first().click();
// This can take a little while to redraw the error bars, so give it a second
await page.waitForTimeout(500);

// barchart is rendered as expected
await expect(page.locator("#review-output")).toHaveScreenshot("barchart-x-axis.png");
Expand All @@ -35,7 +39,7 @@ test("can view output plots", async ({ projectPage }) => {
// When I update a filter
await page.getByRole('button', { name: '55-59', exact: true }).click();
// This can take a little while to redraw the error bars, so give it a second
await page.waitForTimeout(1000);
await page.waitForTimeout(500);

// barchart is rendered as expected
await expect(page.locator("#review-output")).toHaveScreenshot("barchart-update-filter.png");
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/app/static/src/tests/e2e/utils/modelOptionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export async function setValidModelOptions(page: Page) {
.filter({ hasText: /^Area level \(required\)Select\.\.\.Select\.\.\.$/ })
.getByRole("textbox").click();
await page.getByText("District + Metro").click();
await page.locator('div').filter({ hasText: /^Time 1 \(required\)Select\.\.\.Select\.\.\.$/ }).getByRole('textbox').click();
await page.locator('label').filter({ hasText: 'Yes' }).click();
await page.getByRole("button", { name: "Validate" }).click();
await expect(page.getByText("Options are valid")).toBeVisible();
}
2 changes: 1 addition & 1 deletion src/app/static/src/tests/e2e/utils/uploadUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {translate} from "./translationUtils";
const uploadFileTypes = {
spectrum: {
translationKey: "PJNZ",
testFile: "../testdata/Malawi2019.PJNZ"
testFile: "../testdata/Malawi2024.PJNZ"
},
shape: {
translationKey: "shape",
Expand Down
4 changes: 2 additions & 2 deletions src/app/static/src/tests/integration/adr-dataset.itest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,11 @@ describe("ADR dataset-related actions", () => {
const state = await getSelectedDatasetState()

await baselineActions.importPJNZ({commit, state, dispatch, rootState} as any,
"https://raw.githubusercontent.com/hivtools/hint/main/src/app/testdata/Malawi2019.PJNZ");
"https://raw.githubusercontent.com/hivtools/hint/main/src/app/testdata/Malawi2024.PJNZ");

expect(commit.mock.calls[1][0]["type"]).toBe(BaselineMutation.PJNZUpdated);
expect(commit.mock.calls[1][0]["payload"]["filename"])
.toBe("Malawi2019.PJNZ");
.toBe("Malawi2024.PJNZ");
}, 10000);

it("can import shape file", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe("Survey and programme actions", () => {
await baselineActions.uploadShape({commit, dispatch, rootState} as any, formData);

const state = {country: "Malawi"} as any;
const pjnzFormData = getFormData("Malawi2019.PJNZ");
const pjnzFormData = getFormData("Malawi2024.PJNZ");
await baselineActions.uploadPJNZ({commit, state, dispatch, rootState} as any, pjnzFormData);
});

Expand Down
Binary file removed src/app/testdata/Malawi2019.PJNZ
Binary file not shown.
Binary file added src/app/testdata/Malawi2024.PJNZ
Binary file not shown.
Loading

0 comments on commit 5d86fa6

Please sign in to comment.