mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-06-19 21:09:51 +08:00
chore(curriculum): update cat painting steps 11-14 to use specific asserts (#60818)
This commit is contained in:
parent
998185448a
commit
b9ee08ac58
@ -14,43 +14,43 @@ Use a class selector to give your `.box` element a width of `200px`, a height of
|
||||
You should have a `.box` selector.
|
||||
|
||||
```js
|
||||
assert(new __helpers.CSSHelp(document)?.getStyle('.box'))
|
||||
assert.exists(new __helpers.CSSHelp(document)?.getStyle('.box'));
|
||||
```
|
||||
|
||||
Your `.box` selector should have a `width` property set to `200px`.
|
||||
|
||||
```js
|
||||
assert(new __helpers.CSSHelp(document)?.getStyle('.box')?.width === '200px')
|
||||
assert.equal(new __helpers.CSSHelp(document)?.getStyle('.box')?.width, '200px');
|
||||
```
|
||||
|
||||
Your `.box` selector should have a `height` property set to `600px`.
|
||||
|
||||
```js
|
||||
assert(new __helpers.CSSHelp(document)?.getStyle('.box')?.height === '600px')
|
||||
assert.equal(new __helpers.CSSHelp(document)?.getStyle('.box')?.height, '600px');
|
||||
```
|
||||
|
||||
Your `.box` selector should have a `background-color` property set to `#000`.
|
||||
|
||||
```js
|
||||
assert(new __helpers.CSSHelp(document)?.getStyle('.box')?.backgroundColor === 'rgb(0, 0, 0)')
|
||||
assert.equal(new __helpers.CSSHelp(document)?.getStyle('.box')?.backgroundColor, 'rgb(0, 0, 0)');
|
||||
```
|
||||
|
||||
Your `.box` selector should have a `position` property set to `absolute`.
|
||||
|
||||
```js
|
||||
assert(new __helpers.CSSHelp(document)?.getStyle('.box')?.position === 'absolute')
|
||||
assert.equal(new __helpers.CSSHelp(document)?.getStyle('.box')?.position, 'absolute');
|
||||
```
|
||||
|
||||
Your `.box` selector should have a `left` property set to `650px`.
|
||||
|
||||
```js
|
||||
assert(new __helpers.CSSHelp(document)?.getStyle('.box')?.left === '650px')
|
||||
assert.equal(new __helpers.CSSHelp(document)?.getStyle('.box')?.left, '650px');
|
||||
```
|
||||
|
||||
Your `.box` selector should have a `top` property set to `800px`.
|
||||
|
||||
```js
|
||||
assert(new __helpers.CSSHelp(document)?.getStyle('.box')?.top === '800px')
|
||||
assert.equal(new __helpers.CSSHelp(document)?.getStyle('.box')?.top, '800px');
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
@ -16,19 +16,19 @@ After that, scroll up and down to see how the `fixed` value works.
|
||||
Your `.cat-head` selector should have a `position` property set to `fixed`. Make sure you add a semicolon.
|
||||
|
||||
```js
|
||||
assert(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.position === 'fixed')
|
||||
assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.position, 'fixed');
|
||||
```
|
||||
|
||||
Your `.cat-head` selector should have a `top` property set to `100px`. Make sure you add a semicolon.
|
||||
|
||||
```js
|
||||
assert(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.top === '100px')
|
||||
assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.top, '100px');
|
||||
```
|
||||
|
||||
Your `.cat-head` selector should have a `left` property set to `100px`. Make sure you add a semicolon.
|
||||
|
||||
```js
|
||||
assert(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left === '100px')
|
||||
assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '100px');
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
@ -18,19 +18,19 @@ Change the value of the `position` property of `.cat-head` to `sticky`, set `top
|
||||
Your `.cat-head` selector should have a `position` property set to `sticky`. Make sure you add a semicolon.
|
||||
|
||||
```js
|
||||
assert(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.position === 'sticky')
|
||||
assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.position, 'sticky');
|
||||
```
|
||||
|
||||
Your `.cat-head` selector should have a `top` property set to `0`. Make sure you add a semicolon.
|
||||
|
||||
```js
|
||||
assert(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.top === '0px')
|
||||
assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.top, '0px');
|
||||
```
|
||||
|
||||
You should not have the `left` property and its value in your code.
|
||||
|
||||
```js
|
||||
assert.notMatch(code, /left:\s*100px;?/)
|
||||
assert.notMatch(code, /left:\s*100px;?/);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
@ -16,37 +16,37 @@ Give the `.cat-head` element a `position` property set to `absolute`. Set a valu
|
||||
Your `.cat-head` selector should have a `position` property set to `absolute`. Make sure you add a semicolon.
|
||||
|
||||
```js
|
||||
assert(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.position === 'absolute')
|
||||
assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.position, 'absolute');
|
||||
```
|
||||
|
||||
Your `.cat-head` selector should have a `top` property set to `0`. Make sure you add a semicolon.
|
||||
|
||||
```js
|
||||
assert(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.top === '0px')
|
||||
assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.top, '0px');
|
||||
```
|
||||
|
||||
Your `.cat-head` selector should have a `left` property set to `0`. Make sure you add a semicolon.
|
||||
|
||||
```js
|
||||
assert(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left === '0px')
|
||||
assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left, '0px');
|
||||
```
|
||||
|
||||
Your `.cat-head` selector should have a `right` property set to `0`. Make sure you add a semicolon.
|
||||
|
||||
```js
|
||||
assert(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.right === '0px')
|
||||
assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.right, '0px');
|
||||
```
|
||||
|
||||
Your `.cat-head` selector should have a `bottom` property set to `0`. Make sure you add a semicolon.
|
||||
|
||||
```js
|
||||
assert(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.bottom === '0px')
|
||||
assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.bottom, '0px');
|
||||
```
|
||||
|
||||
Your `.cat-head` selector should have a `margin` property set to `auto`. Make sure you add a semicolon.
|
||||
|
||||
```js
|
||||
assert(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.margin === 'auto')
|
||||
assert.equal(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.margin, 'auto');
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
Loading…
Reference in New Issue
Block a user