Skip to content

Commit

Permalink
Add for-the-badge test
Browse files Browse the repository at this point in the history
  • Loading branch information
uniibu authored and hulkoba committed Mar 13, 2018
1 parent 1b861c8 commit 0d6ddf3
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/badges.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,27 @@ describe('badges', async () => {
expect(payload).toMatch(/#4c1/)
})

test('returns for-the-badge style', async () => {
const { repositories } = await dbs()

await repositories.post({
type: 'repository',
fullName: 'Repo/public_enabled',
enabled: true
})

const { payload, statusCode } = await server.inject({
method: 'GET',
url: '/repo/public_enabled.svg?style=for-the-badge'
})

expect(statusCode).toBe(200)
expect(payload).toMatch(/enabled/)
expect(payload).toMatch(/Greenkeeper/)
expect(payload).toMatch(/#555/)
expect(payload).toMatch(/#4c1/)
})

test('returns correct flat-square style even if used with other query', async () => {
const { repositories, payments } = await dbs()

Expand Down

0 comments on commit 0d6ddf3

Please sign in to comment.