international-labour-organization / ilo_base_theme

A Drupal theme that implements the ILO Design System
Apache License 2.0
1 stars 0 forks source link

Create test module for cypress #15

Closed justintemps closed 4 months ago

justintemps commented 5 months ago

Create a module that accepts GET requests with a properly encoded JSON in the query string so that cypress can run tests against the components with different settings passed in.

ademarco commented 5 months ago

I'm gonna provide a test module that will be enabled by default in the Docker container, this module will expose a page that, given the pattern ID and fields, will render it.

For example, the following URL will generate the following pattern:

http://localhost:8081/pattern-preview?id=button&fields=%7b%0a%22label%22%3a%20%22Button%22%2c%0a%22type%22%3a%20%22primary%22%2c%0a%22kind%22%3a%20%22button%22%2c%0a%22size%22%3a%20%22medium%22%0a%7d

image

ademarco commented 5 months ago

This is now ready to be reviewed at the linked PR. A useful tool to encode JSON for manual testing can be found here https://onlinetools.com/json/url-encode-json#tool