Files
shields/services/github/github-issue-detail.tester.js
jNulljandPierre-Yves Bigourdan 28839b2502 add not-planned and duplicate to issue state to [GithubIssueDetail] (#11666)
* add not-planned and duplicate to issue state to [GithubIssueDetail]

Fixes GitHub issues/PRs - Support the "not planned" state
Fixes #11662

* fix: replace underscore with space in state reason response transformation

* fix: tests after not_planed replaced by not planned

* fix: update issue state color key from not_planned to not planned

* improve testing, forever closed

Co-authored-by: Pierre-Yves Bigourdan <10694593+PyvesB@users.noreply.github.com>

* remove redundent condition

---------

Co-authored-by: Pierre-Yves Bigourdan <10694593+PyvesB@users.noreply.github.com>
2026-02-08 19:12:18 +00:00

80 lines
2.3 KiB
JavaScript

import Joi from 'joi'
import { isFormattedDate } from '../test-validators.js'
import { createServiceTester } from '../tester.js'
export const t = await createServiceTester()
t.create('github issue state')
.get('/issues/detail/state/badges/shields/979.json')
.expectBadge({
label: 'issue 979',
message: 'closed',
})
t.create('github issue state (repo not found)')
.get('/issues/detail/state/badges/helmets/979.json')
.expectBadge({
label: 'issue/pull request',
message: 'issue, pull request or repo not found',
})
t.create('github issue title')
.get('/issues/detail/title/badges/shields/979.json')
.expectBadge({
label: 'issue 979',
message: 'Github rate limits cause transient service test failures in CI',
})
t.create('github issue author')
.get('/issues/detail/author/badges/shields/979.json')
.expectBadge({ label: 'author', message: 'paulmelnikow' })
t.create('github issue label')
.get('/issues/detail/label/badges/shields/979.json')
.expectBadge({
label: 'label',
message: Joi.equal(
'bug | developer-experience',
'developer-experience | bug',
),
})
t.create('github issue comments')
.get('/issues/detail/comments/badges/shields/979.json')
.expectBadge({
label: 'comments',
message: Joi.number().greater(15),
})
t.create('github issue age')
.get('/issues/detail/age/badges/shields/979.json')
.expectBadge({ label: 'created', message: isFormattedDate })
t.create('github issue update')
.get('/issues/detail/last-update/badges/shields/979.json')
.expectBadge({ label: 'updated', message: isFormattedDate })
t.create('github pull request merge state')
.get('/pulls/detail/state/pingcap/raft-rs/201.json')
.expectBadge({ label: 'pull request 201', message: 'merged' })
t.create('github pull request merge state (pull request not found)')
// it's an issue
.get('/pulls/detail/state/pingcap/raft-rs/177.json')
.expectBadge({
label: 'issue/pull request',
message: 'issue, pull request or repo not found',
})
t.create('github issue milestone')
.get('/issues/detail/milestone/badges/shields/745.json')
.expectBadge({
label: 'milestone',
message: 'Next Deploy',
})
t.create('github issue milestone (without milestone)')
.get('/issues/detail/milestone/badges/shields/979.json')
.expectBadge({
message: 'no milestone',
})