mirror of
https://github.com/actions/add-to-project.git
synced 2025-12-12 13:07:21 +00:00
Add test
This commit is contained in:
@@ -537,6 +537,49 @@ describe('addToProject', () => {
|
|||||||
projectNumber: 1
|
projectNumber: 1
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('compares labels case-insensitively', async () => {
|
||||||
|
mockGetInput({
|
||||||
|
'project-url': 'https://github.com/orgs/github/projects/1',
|
||||||
|
'github-token': 'gh_token',
|
||||||
|
labeled: 'FOO, Bar, baz',
|
||||||
|
'label-operator': 'AND'
|
||||||
|
})
|
||||||
|
|
||||||
|
github.context.payload = {
|
||||||
|
issue: {
|
||||||
|
number: 1,
|
||||||
|
labels: [{ name: 'foo' }, { name: 'BAR' }, { name: 'baz' }]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mockGraphQL(
|
||||||
|
{
|
||||||
|
test: /getProject/,
|
||||||
|
return: {
|
||||||
|
organization: {
|
||||||
|
projectNext: {
|
||||||
|
id: 'project-next-id'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /addProjectNextItem/,
|
||||||
|
return: {
|
||||||
|
addProjectNextItem: {
|
||||||
|
projectNextItem: {
|
||||||
|
id: 'project-next-item-id'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
await addToProject()
|
||||||
|
|
||||||
|
expect(outputs.itemId).toEqual('project-next-item-id')
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('mustGetOwnerTypeQuery', () => {
|
describe('mustGetOwnerTypeQuery', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user