Added validation for the case the header is not a string

This commit is contained in:
Luis 2023-11-14 14:38:16 +00:00 committed by Luis Aleixo
parent 43a6b6e0a6
commit ac2e8b799d
2 changed files with 3 additions and 2 deletions

View file

@ -64,6 +64,7 @@ function uploadFile(endpoint) {
const cellValue = worksheet[headerCoordinates[header]]?.v;
if (
!cellValue ||
$.type(cellValue) !== "string" ||
cellValue.trim().toLowerCase() !== header.toLowerCase()
) {
$("#upload-error")

View file

@ -171,8 +171,8 @@ def test_ventilation_window_hepa(baseline_form: model_generator.FormData):
@pytest.mark.parametrize(
["activity", "total_people", "infected_people", "error"],
[
['office', 10, 11, "Number of infected people cannot be more or equal than number of total people."],
['office', 10, 10, "Number of infected people cannot be more or equal than number of total people."],
['office', 10, 11, "Number of infected people cannot be greater or equal to the number of total people"],
['office', 10, 10, "Number of infected people cannot be greater or equal to the number of total people"],
['training', 10, 2, "Conference/Training activities are limited to 1 infected."],
]
)