-
Notifications
You must be signed in to change notification settings - Fork 0
Add tests for the data product form functions. #37
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
Open
alexandercyu
wants to merge
22
commits into
main
Choose a base branch
from
add-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Tests for the functions in dataproduct-form.js.