-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
}) | ||
}) |