Skip to content

Commit

Permalink
test: cover replacement of all lighten and darken functions
Browse files Browse the repository at this point in the history
  • Loading branch information
luis-almeida committed Aug 5, 2024
1 parent b828b9c commit 0ddadb4
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions packages/zcli-themes/src/lib/zass.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,24 @@ describe('zass', () => {
`))
})

it('replaces multiple instances of `darken` with different arguments', () => {
expect(minify(zass(`
div {
background-color: darken( #ff33cc, 10% );
background-color: darken( #ff5, 10% );
background-color: darken( rgb(255, 1, 2), 10% );
background-color: darken( hsla(180, 50%, 50%, 0.2), 20% );
}
`, [], []))).to.deep.equal(minify(`
div {
background-color: #ff00bf;
background-color: #ff2;
background-color: #cd0001;
background-color: rgba(38, 115, 115, .2);
}
`))
})

it('darkens a color defined in variables', () => {
expect(minify(zass(
'div { background-color: darken( $cool_color, 10% ) }',
Expand Down Expand Up @@ -108,6 +126,24 @@ describe('zass', () => {
`))
})

it('replaces multiple instances of `lighten` with different arguments', () => {
expect(minify(zass(`
div {
background-color: lighten( #5566ff, 10% );
background-color: lighten( #55d, 10% );
background-color: lighten( rgb(255, 1, 2), 10% );
background-color: lighten( hsla(180, 50%, 50%, 0.2), 20% );
}
`, [], []))).to.deep.equal(minify(`
div {
background-color: #8894ff;
background-color: #8080e6;
background-color: #ff3435;
background-color: rgba(140, 217, 217, .2);
}
`))
})

it('darkens a color defined in variables', () => {
expect(minify(zass(
'div { background-color: lighten( $cool_color, 10% ) }',
Expand Down

0 comments on commit 0ddadb4

Please sign in to comment.