-
Notifications
You must be signed in to change notification settings - Fork 48
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
Adding tests that verify that the entire build setup is working as expected #1040
Conversation
|
Design Token Diff
|
it('it should transform with css/variables format', () => { | ||
const output = fs.readFileSync(`${basePath}/build/css/variables.css`, 'utf8') | ||
const expectedOutput = `:root { | ||
--prefix-base-color-blue-500: #2C29FF; /* The primary color for interactive elements. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qq... should this test instead assert that the prefix isn't applied to base tokens and only functional ones?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? This is not the expected behavior for this config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on https://github.com/primer/primitives/pull/1040/files#r1740667105 I think I got my answer. The opinionated rules are applied in a different stage in the build process, so this isn't representative of an end-to-end test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I will add tests for this as well. Those are the baselines. :D
const output = fs.readFileSync(`${basePath}/build/css/variables.css`, 'utf8') | ||
const expectedOutput = `:root { | ||
--prefix-base-color-blue-500: #2C29FF; /* The primary color for interactive elements. */ | ||
--prefix-fg-color-link: #2C29FF; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar question for this one.. the input is fgColor
but output is fg-color
. Is that normals? I'd expect it to also be fgColor
in output?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is currently just testing the default naming transforms. Here this is expected behavior. I will add our custom name transformers and then this would be the expected behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah okay.. so there's another transformer that does that, i think that makes sense then 👍
Summary
List of notable changes:
What should reviewers focus on?
Steps to test: