mirror of
https://github.com/badges/shields.git
synced 2025-04-18 19:44:04 +03:00
25 lines
687 B
JavaScript
25 lines
687 B
JavaScript
import { test, given } from 'sazerac'
|
|
import { renderWebsiteStatus } from './website-status.js'
|
|
|
|
describe('Website status helpers', function () {
|
|
const customOptions = {
|
|
upMessage: 'groovy',
|
|
upColor: 'papayawhip',
|
|
downMessage: 'no good',
|
|
downColor: 'gray',
|
|
}
|
|
|
|
test(renderWebsiteStatus, () => {
|
|
given({ isUp: true }).expect({ message: 'up', color: 'brightgreen' })
|
|
given({ isUp: false }).expect({ message: 'down', color: 'red' })
|
|
given({ isUp: true, ...customOptions }).expect({
|
|
message: 'groovy',
|
|
color: 'papayawhip',
|
|
})
|
|
given({ isUp: false, ...customOptions }).expect({
|
|
message: 'no good',
|
|
color: 'gray',
|
|
})
|
|
})
|
|
})
|