Skip to content

Conversation

@alexandercyu
Copy link
Collaborator

Tests for the functions in dataproduct-form.js.

Add module exports for tests
Change gitignore to only ignore the node files in the tests directory
Add initializeUploadDiv function to the test
Add tests for dataproduct-form.js
jest configs for vanilla JS
Dependencies for tests
Package-lock file for tests node environment
Add exports for functions to be tested.
In Progress

- add tests for functions in dataproduct-form.js
-add test for updateIndex() function -> tests that the correct index number is output
- add test for initializePointInputDiv() function -> tests that the coordinate input fields are added when a geometry that is not geojson or null is chosen
- add test for initializeUploadDiv() -> tests that the function adds the textarea for geometry if geojson is chosen
- add test for createInputCoordinatesRow() -> test that a new row of inputs for geometry coordinates is created
- In progress: test addPoint() function
-Change initialization of Geometry input to use addPoint function instead of creatInputCoordinatesRow function

- TODO: find out why Remove buttons are added to the default input rows
- Refactored createInputCoordinatesRow() and addPoint() functions into one function.  Only addPoint() will be called when initializing the input rows for the Geometry section and when adding new  coordinate input rows for a geometry
- removed createInputCoordinatesRow() function
- removed calls to createInputCoordinatesRow() function
- added parameter in addPoint() to denote when the function is being called to create initial input rows or adding input rows
- removed condition in addPoint() to show the Remove button  specifically for the first input row when additional input rows are added
- uncommented page redirect that was commented for testing
- removed createInputCoordiantesRow from testing exports
- remove the previous export object for addPointTest (addPoint exported through module)
- add exports for addAuthor, addModel, addOther, geoPolygon2
- add imports for geoPolygon2, addAuthor, addModel, addOther
- remove import for createInpurCoordinatesRow
-add a beforeEach hook that sets up the HTML elements the DOM manipulator tests will use
- add tests for geoPolygon2, addAuthor, addOther
- In progress: test for addModel
- added nunjucks requirement for rendering jinja template for testing Model section inputs
- added "geojson" and "geonull" entries for testing geoPolygon2 function
- added template data and template string for nunjucks to render
Indented template tag for bette readability
Added nunjucks as a dependency
Added nunjucks as a dependency
- added ID to remove Author button, as revealed by test
Add ID for remove buttons in the Geometry section
- Comment out the dropdownTemplate function in the beforeEach setup because this doesn't generate a usable dropdown for use in the test (maybe it can be reworked later)
- add the removeEntry click event listener for the test
- change comment syntax type for readability
- create the dropdowns for Model using nunjucks strings so the function reading from the 'template' tag doesn't throw an error. (Test for Model section cannot be made due to nunjucks string)
- add test for removeEntry and makeInputRequired functions
edited test description
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants