Skip to content

Rework components color tests to a proper testing method #38

Open
@gabrieldrn

Description

  • Currently, colors unit tests for components are wrongly written as they directly copy the implemented function instead of comparing the result of each computed color to the expected colors as documented in Carbon's website. Those colors can be obtained from the JSON theme files generated by the :doc-parser module.
  • To be used, those JSON themes files must be deserialized inside tests, so code dedicated to this deserialization should be moved to a new module.
  • Also, those files should be put in the resources folder to then be bundled for every target. But this is currently impossible because of the Wasm target:
    • From the tests, JSON theme files have to be read. kotlinx-io seems to be the best lib for this task, as it’s based on Okio and maintained by JetBrains.
    • For the Wasm/Js target, there is no proper file system accessor yet, but Wasm/Wasi has one → Should the target be changed to Wasm/Wasi? WASI is in a preview state, and Wasm/Wasi for Kotlin is in Alpha.
    • Someone published a library to bundle test resources in each target https://github.com/goncalossilva/kotlinx-resources/ but it doesn't support Wasm target yet -> Add WASM support goncalossilva/kotlinx-resources#91.
    • It seems like there is no solution on how to bundle resources fiels into the wasm target, and I (@gabrieldrn) am not able to find a solution too.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    code coveragecomplexVery complex or may be impossible to resolvehelp wantedExtra attention is needed

    Projects

    • Status

      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions