Files
shields/services/obs/obs.tester.js
Florian "sp1rit 8a9efb2fc9 [OBS] add Open Build Service service-badge (#6993)
* service: add obs service

* service: obs: replaced replaceAll with replace and global regex

* service: obs: added space between class members

* service: obs: support for multiple instances

* service: obs: removed user prefix from auth vars

obs_userName is now called obs_user and obs_userPass is called obs_pass

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>

* service: obs: removed constructor hack in favour of serviceKey

* service: obs: apply suggestions from @calebcartwright

* service: obs: remove unneccesary http status mappings

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-09-25 17:44:56 +00:00

26 lines
686 B
JavaScript

import { ServiceTester } from '../tester.js'
import { noToken } from '../test-helpers.js'
import ObsService from './obs.service.js'
import { isBuildStatus } from './obs-build-status.js'
export const t = new ServiceTester({
id: 'obs',
title: 'openSUSE Open Build Service',
})
t.create('status (valid)')
.skipWhen(noToken(ObsService))
.get('/openSUSE:Factory/aaa_base/standard/x86_64.json?label=standard')
.expectBadge({
label: 'standard',
message: isBuildStatus,
})
t.create('status (invalid)')
.skipWhen(noToken(ObsService))
.get('/home:sp1rit/this_package_will_never_exist/repo/arch.json')
.expectBadge({
label: 'build',
message: 'not found',
})