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

🐢 Add Layer Test Suite πŸ§ͺ #1196

Merged
merged 8 commits into from
Mar 27, 2024

Conversation

RobAndrewHurst
Copy link
Contributor

🐢 Add Layer Test Suite πŸ§ͺ

πŸ“ Description

This pull request introduces a new test suite for the layers in a mapview. The purpose of this test suite is to ensure the integrity and functionality of each layer within the mapview. This will hit queries and templates belong to a layer.

πŸ› οΈ Changes

  • Added a new function layerTest that takes a mapview object as a parameter.
  • Inside the layerTest function, a test suite is created using the describe function from the codi test library.
  • The test suite iterates over each layer in the mapview.layers object using a for...in loop.
  • For each layer, an individual test case is created using the it function.
  • The test case checks if the layer's format is either 'maplibre' or 'tiles', or if the layer has an infoj property.
  • If the condition is met, the test case proceeds to retrieve the last location associated with the layer by making an API call to ${mapp.host}/api/query with the appropriate query parameters.
  • The test case asserts that the retrieved last location has a defined id property using the assertTrue function.
  • If the last location has an id, the test case retrieves the corresponding location using mapp.location.get with the layer and location ID.
  • Finally, the retrieved location is removed using the remove method.

✨ Benefits

  • Ensures the correctness and functionality of each layer in the mapview. βœ…
  • Helps identify any issues or inconsistencies related to layer formats, last locations, and location retrieval. πŸ›
  • Provides a structured way to test and maintain the layers in the mapview. πŸ“Š

πŸš€ Testing

  • To run the test suite, you can simply hit the test view on localhost or any deployed instance.

Please let me know if you have any questions or if there are any additional changes required for this pull request. 😊

@RobAndrewHurst RobAndrewHurst added the Testing Changes relating to existing or new unit tests. label Mar 26, 2024
@RobAndrewHurst
Copy link
Contributor Author

Screen.Recording.2024-03-26.at.15.59.20.mov

Copy link
Contributor

@AlexanderGeere AlexanderGeere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on a few template layers. looks good to me!

@RobAndrewHurst RobAndrewHurst marked this pull request as draft March 27, 2024 09:05
@RobAndrewHurst RobAndrewHurst marked this pull request as ready for review March 27, 2024 10:36
Copy link

sonarcloud bot commented Mar 27, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Contributor

@simon-leech simon-leech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All working for me @RobAndrewHurst - love it!
So so good!

@RobAndrewHurst RobAndrewHurst merged commit 1e75ff9 into GEOLYTIX:main Mar 27, 2024
5 checks passed
@RobAndrewHurst RobAndrewHurst deleted the codi branch March 27, 2024 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing Changes relating to existing or new unit tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants