mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(curriculum,tests): use computed styles for cat painting step 8 (#51479)
This commit is contained in:
+6
-2
@@ -28,13 +28,17 @@ assert.match(code, /background:\s*linear-gradient\(/)
|
||||
Your `linear-gradient` function should set the first color to be `#5e5e5e` at `85%`.
|
||||
|
||||
```js
|
||||
assert.match(code, /background:\s*linear-gradient\(#5e5e5e\s+85%/)
|
||||
const gradientBackgroundImage = new __helpers.CSSHelp(document).getStyle('.cat-head')?.getPropVal('background-image', true);
|
||||
const firstGradient = gradientBackgroundImage.split(/\s*rgb\s*/)[1];
|
||||
assert.equal(firstGradient,'(94,94,94)85%,');
|
||||
```
|
||||
|
||||
Your `linear-gradient` function should set the second color to be `#45454f` at `100%`.
|
||||
|
||||
```js
|
||||
assert.match(code, /background:\s*linear-gradient\(#5e5e5e\s+85%,\s+#45454f\s+100%\);?/)
|
||||
const gradientBackgroundImage = new __helpers.CSSHelp(document).getStyle('.cat-head')?.getPropVal('background-image', true);
|
||||
const secondGradient = gradientBackgroundImage.split(/\s*rgb\s*/)[2];
|
||||
assert.equal(secondGradient,'(69,69,79)100%)');
|
||||
```
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user