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

Automatic test on voorbeeld theme #567

Open
3 tasks
bddjong opened this issue Jun 11, 2024 · 0 comments
Open
3 tasks

Automatic test on voorbeeld theme #567

bddjong opened this issue Jun 11, 2024 · 0 comments

Comments

@bddjong
Copy link
Contributor

bddjong commented Jun 11, 2024

Description

Context

The voorbeeld theme contains a lot of utrecht- and some denhaag- tokens. In the future it might contain tokens from other organisations as well.

Problem

It turns out that some of the utrecht- tokens in the theme, don't actually exist in the code of the relevant Utrecht component. For example, the voorbeeld theme has utrecht-alert-informative-... whereas the actual Utrecht Alert has utrecht-alert-info-....

Why is this a problem?

UX designers might copy the voorbeeld figma library, and use it to design their components and define their organisations theme. When a developer actually tries applying that theme to an application using the components, the tokens won't do anything, because the code doesn't actually use them.

Solutions

Since the voorbeeld theme is manually updated in Figma, we can't change too much there. However, when the voorbeeld theme is pushed to a github branch to be updated, we could use the CI to verify that the tokens that are exported actually exist.

How?

  • voorbeeld.tokens.json is read in a test
  • Go through all non todo- tokens -> verify that the token exists in the organisations tokens
  • example: utrecht-alert-informative-color -> does it exist in the utrecht tokens?
  • Fail a test and output a list of non-existing tokens to make it easy to correct in Figma

Not certain:

  • Which files can we base the check on? Some organisations might not have ever token in their own theme, even though the code does support it. Is there an all-inclusive "tokens.json" for every organisation?

Acceptance criteria

  • voorbeeld.tokens.json is automatically checked to make sure it does not contain non-existing organisation tokens.
  • Failed test if non-existing tokens are present
  • List of non-existing tokens is visible
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

No branches or pull requests

1 participant