1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

add some tests

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2020-11-10 09:16:22 -05:00
parent cc0331cd12
commit c507343d72
2 changed files with 19 additions and 1 deletions

View File

@ -22,7 +22,7 @@ export class DrawerItem extends React.Component<DrawerItemProps> {
return (
<div {...elemProps} className={classNames} title={title}>
<span className="name">{name}</span>
<div className="value">{content}</div>
<span className="value">{content}</span>
</div>
)
}

View File

@ -0,0 +1,18 @@
import React from "react"
import { displayBooleans } from "../display-booleans"
describe("displayBooleans tests", () => {
it("should not do anything to div's if shouldShow is false", () => {
expect(displayBooleans(false, <div></div>)).toStrictEqual(<div></div>)
})
it("should not do anything to booleans's if shouldShow is false", () => {
expect(displayBooleans(false, true)).toStrictEqual(true)
expect(displayBooleans(false, false)).toStrictEqual(false)
})
it("should stringify booleans when shouldShow is true", () => {
expect(displayBooleans(true, true)).toStrictEqual("true")
expect(displayBooleans(true, false)).toStrictEqual("false")
})
})