Skip to content

Commit

Permalink
test: project cards
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Nov 17, 2017
1 parent 9110ae1 commit 8973c5e
Showing 1 changed file with 88 additions and 0 deletions.
88 changes: 88 additions & 0 deletions test/integration/project-cards-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
const chai = require('chai')
const fixtures = require('@octokit/fixtures')

const GitHub = require('../../')

const mocha = require('mocha')
const describe = mocha.describe
const it = mocha.it
chai.should()

describe('api.github.com', () => {
it('github.projects.*ProjectCard()', () => {
const GitHubMock = fixtures.mock('api.github.com/project-cards')

const github = new GitHub()

github.authenticate({
type: 'token',
token: '0000000000000000000000000000000000000001'
})

return github.projects.createProjectCard({
column_id: 1000,
note: 'Example card 1'
})

.then(() => {
return github.projects.createProjectCard({
column_id: 1000,
note: 'Example card 2'
})
})

.then(() => {
return github.projects.getProjectCards({
column_id: 1000
})
})

.then(() => {
return github.projects.getProjectCard({
id: 1000
})
})

.then(() => {
return github.projects.updateProjectCard({
id: 1000,
note: 'Example card 1 updated'
})
})

.then(() => {
return github.projects.moveProjectCard({
id: 1000,
position: 'top',
column_id: 1001
})
})

.then(() => {
return github.projects.moveProjectCard({
id: 1001,
position: 'bottom',
column_id: 1001
})
})

.then(() => {
return github.projects.moveProjectCard({
id: 1000,
position: 'after:1001'
})
})

.then(() => {
return github.projects.deleteProjectCard({
id: 1000
})
})

.then((response) => {
GitHubMock.pending().should.deep.equal([])
})

.catch(GitHubMock.explain)
})
})

0 comments on commit 8973c5e

Please sign in to comment.