adobe / adobe/leonardo

Failing tests

Open
#156 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
2.1k
Forks
130
PR merge metrics
No merged PRs in 30d

Description

## Description

Failing tests require more investigation as to why they are failing.

#### `themeSetters.test`: 'should set contrast multiple times'
This test should return gray100 value as "#ffffff". The value is defined as having 1:1 contrast with background color of "#ffffff". Regardless of any alterations to contrast for the theme, the returned color should equal the background color value. **Test currently returns "#fefefe"**.

#### `theme.test`: 'should generate 2 colors with bidirectional contrast (dark background)'
This test should return a color value meeting (or exceeding) 4.5:1 contrast with background. Expected value to return would be "#9895c0" compared against background of "#323232". **Test currently returns value "#9894c0", which is 4.48:1 contrast**.

One consideration is to see if there were updates regarding the threshold value for inverting ratios or searchColor function. Ie, if they target an HSLuv value of 50% vs JCH value of 50% (different values), or if the actual percent is different (50% vs 49% or < x vs <= x);

## Steps to reproduce

- Pull latest work that includes PR #155
- In terminal, move to contrast-colors directory (`cd packages/contrast-colors`)
- Run `yarn test`

## Expected behavior

1. Expect colors that are 1:1 of same hue/sat to be the same color as background
2. Expect colors with target ratio 4.5:1 to return 4.5:1 or greater

## Screenshots

## Leonardo package and version

## Environment
- **Browser(s) and OS(s):**

## Additional context

Contributor guide

Open the contributing guide

Research direction

In packages/contrast-colors, run yarn test and inspect the failures for themeSetters.test ('should set contrast multiple times') and theme.test ('should generate 2 colors with bidirectional contrast (dark background)'). Trace the contrast threshold or searchColor behavior mentioned in the issue, then verify that the first result is #ffffff and the second meets at least 4.5:1 contrast.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
accessibility, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.