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:
parent
cc0331cd12
commit
c507343d72
@ -22,7 +22,7 @@ export class DrawerItem extends React.Component<DrawerItemProps> {
|
|||||||
return (
|
return (
|
||||||
<div {...elemProps} className={classNames} title={title}>
|
<div {...elemProps} className={classNames} title={title}>
|
||||||
<span className="name">{name}</span>
|
<span className="name">{name}</span>
|
||||||
<div className="value">{content}</div>
|
<span className="value">{content}</span>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
18
src/renderer/utils/__tests__/display-booleans.test.tsx
Normal file
18
src/renderer/utils/__tests__/display-booleans.test.tsx
Normal 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")
|
||||||
|
})
|
||||||
|
})
|
||||||
Loading…
Reference in New Issue
Block a user