Select Git revision
gitlab.spec.js.snap
gitlab.spec.js.snap 8.55 KiB
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`api/gitlab addAssignees(issueNo, assignees) should add the given assignees to the issue 1`] = `
Array [
Array [
"projects/some%2Frepo/merge_requests/42?assignee_id=someuser",
],
]
`;
exports[`api/gitlab addAssignees(issueNo, assignees) should log error if more than one assignee 1`] = `
Array [
Array [
"projects/some%2Frepo/merge_requests/42?assignee_id=someuser",
],
]
`;
exports[`api/gitlab addLabels(issueNo, labels) should add the given labels to the issue 1`] = `
Array [
Array [
"projects/some%2Frepo/merge_requests/42?labels=foo,bar",
],
]
`;
exports[`api/gitlab createFile(branchName, filePath, fileContents, message) createBranch(branchName) creates file with v3 1`] = `
Array [
Array [
"projects/some-repo/repository/branches",
Object {
"body": Object {
"branch_name": "some-branch",
"ref": undefined,
},
},
],
]
`;
exports[`api/gitlab createFile(branchName, filePath, fileContents, message) createBranch(branchName) creates file with v4 1`] = `
Array [
Array [
"projects/undefined/repository/branches",
Object {
"body": Object {
"branch": "some-branch",
"ref": undefined,
},
},
],
]
`;
exports[`api/gitlab createFile(branchName, filePath, fileContents, message) creates file with v3 1`] = `
Array [
Array [
"projects/some-repo/repository/files",
Object {
"body": Object {
"branch_name": "some-branch",
"commit_message": "some-message",
"content": "c29tZS1jb250ZW50cw==",
"encoding": "base64",
"file_path": "some-path",
},
},
],
]
`;
exports[`api/gitlab createFile(branchName, filePath, fileContents, message) creates file with v4 1`] = `
Array [
Array [
"projects/undefined/repository/files/some-path",
Object {
"body": Object {
"branch": "some-branch",
"commit_message": "some-message",
"content": "c29tZS1jb250ZW50cw==",
"encoding": "base64",
},
},
],
]
`;
exports[`api/gitlab createFile(branchName, filePath, fileContents, message) getSubDirectories(path) should return subdirectories 1`] = `
Array [
Array [
"projects/owned",
],
Array [
"projects/some%2Frepo",
],
Array [
"user",
],
Array [
"projects/some%2Frepo/repository/tree?path=some-path",
],
]
`;
exports[`api/gitlab createFile(branchName, filePath, fileContents, message) getSubDirectories(path) should return subdirectories 2`] = `
Array [
"a",
]
`;
exports[`api/gitlab createFile(branchName, filePath, fileContents, message) updateFile(branchName, filePath, fileContents, message) creates file with v3 1`] = `
Array [
Array [
"projects/some-repo/repository/files",
Object {
"body": Object {
"branch_name": "some-branch",
"commit_message": "some-message",
"content": "c29tZS1jb250ZW50cw==",
"encoding": "base64",
"file_path": "some-path",
},
},
],
]
`;
exports[`api/gitlab createFile(branchName, filePath, fileContents, message) updateFile(branchName, filePath, fileContents, message) creates file with v4 1`] = `
Array [
Array [
"projects/undefined/repository/files/some-path",
Object {
"body": Object {
"branch": "some-branch",
"commit_message": "some-message",
"content": "c29tZS1jb250ZW50cw==",
"encoding": "base64",
},
},
],
]
`;
exports[`api/gitlab createPr(branchName, title, body) returns the PR 1`] = `
Object {
"displayNumber": "Merge Request #12345",
"id": 1,
"iid": 12345,
"number": 1,
}
`;
exports[`api/gitlab createPr(branchName, title, body) returns the PR 2`] = `
Array [
Array [
"projects/undefined/merge_requests",
Object {
"body": Object {
"description": "the-body",
"remove_source_branch": true,
"source_branch": "some-branch",
"target_branch": undefined,
"title": "some-title",
},
},
],
]
`;
exports[`api/gitlab createPr(branchName, title, body) uses default branch 1`] = `
Object {
"displayNumber": "Merge Request #12345",
"id": 1,
"iid": 12345,
"number": 1,
}
`;
exports[`api/gitlab createPr(branchName, title, body) uses default branch 2`] = `
Array [
Array [
"projects/undefined/merge_requests",
Object {
"body": Object {
"description": "the-body",
"remove_source_branch": true,
"source_branch": "some-branch",
"target_branch": undefined,
"title": "some-title",
},
},
],
]
`;
exports[`api/gitlab findFilePaths(fileName) should return the files matching the fileName 1`] = `
Array [
"package.json",
"src/app/package.json",
"src/otherapp/package.json",
]
`;
exports[`api/gitlab getBranch returns a branch 1`] = `"foo"`;
exports[`api/gitlab getBranchLastCommitTime should return a Date 1`] = `2012-09-20T08:50:22.000Z`;
exports[`api/gitlab getBranchPr(branchName) should return null if no PR exists 1`] = `
Array [
Array [
"projects/owned",
],
Array [
"projects/some%2Frepo",
],
Array [
"user",
],
Array [
"projects/some%2Frepo/merge_requests?state=opened",
],
]
`;
exports[`api/gitlab getBranchPr(branchName) should return the PR object 1`] = `
Array [
Array [
"projects/owned",
],
Array [
"projects/some%2Frepo",
],
Array [
"user",
],
Array [
"projects/some%2Frepo/merge_requests?state=opened",
],
Array [
"projects/some%2Frepo/merge_requests/undefined",
],
Array [
"projects/some%2Frepo/repository/branches/some-branch",
],
]
`;
exports[`api/gitlab getBranchPr(branchName) should return the PR object 2`] = `
Object {
"additions": 1,
"base": Object {
"sha": "1234",
},
"body": undefined,
"commits": 1,
"deletions": 1,
"displayNumber": "Merge Request #91",
"iid": 91,
"number": undefined,
"source_branch": "some-branch",
}
`;
exports[`api/gitlab getCommitMessages() returns commits messages 1`] = `
Array [
"foo",
"bar",
]
`;
exports[`api/gitlab getFile(filePath, branchName) gets the file with v3 1`] = `Object {}`;
exports[`api/gitlab getFile(filePath, branchName) gets the file with v3 2`] = `"foo"`;
exports[`api/gitlab getFile(filePath, branchName) gets the file with v4 by default 1`] = `"foo"`;
exports[`api/gitlab getFileContent(filePath, branchName) gets the file 1`] = `"~�"`;
exports[`api/gitlab getFileContent(filePath, branchName) throws error for non-404 1`] = `
Object {
"statusCode": 403,
}
`;
exports[`api/gitlab getPr(prNo) returns the PR 1`] = `
Object {
"body": "a merge request",
"canRebase": true,
"description": "a merge request",
"displayNumber": "Merge Request #12345",
"id": 1,
"iid": 12345,
"isClosed": true,
"isUnmergeable": true,
"merge_status": "cannot_be_merged",
"number": 12345,
"source_branch": "some-branch",
"state": "merged",
}
`;
exports[`api/gitlab getRepos should return an array of repos 1`] = `
Array [
Array [
"projects?membership=true&per_page=100",
Object {
"paginate": true,
},
],
]
`;
exports[`api/gitlab getRepos should return an array of repos 2`] = `
Array [
"a/b",
"c/d",
]
`;
exports[`api/gitlab getRepos should support a custom endpoint 1`] = `
Array [
Array [
"projects?membership=true&per_page=100",
Object {
"paginate": true,
},
],
]
`;
exports[`api/gitlab getRepos should support a custom endpoint 2`] = `
Array [
"a/b",
"c/d",
]
`;
exports[`api/gitlab initRepo should initialise the config for the repo - 0 1`] = `
Array [
Array [
"projects/owned",
],
Array [
"projects/some%2Frepo",
],
Array [
"user",
],
]
`;
exports[`api/gitlab initRepo should initialise the config for the repo - 0 2`] = `Object {}`;
exports[`api/gitlab initRepo should initialise the config for the repo - 1 1`] = `
Array [
Array [
"projects/owned",
],
Array [
"projects/some%2Frepo",
],
Array [
"user",
],
]
`;
exports[`api/gitlab initRepo should initialise the config for the repo - 1 2`] = `Object {}`;
exports[`api/gitlab initRepo should initialise the config for the repo - 2 1`] = `
Array [
Array [
"projects/owned",
],
Array [
"projects/some%2Frepo",
],
Array [
"user",
],
]
`;
exports[`api/gitlab initRepo should initialise the config for the repo - 2 2`] = `Object {}`;
exports[`api/gitlab initRepo should use api v4 1`] = `Object {}`;
exports[`api/gitlab initRepo uses provided logger 1`] = `Object {}`;
exports[`api/gitlab setBaseBranch(branchName) sets the base branch 1`] = `
Array [
Array [
"projects/owned",
],
Array [
"projects/some%2Frepo",
],
Array [
"user",
],
]
`;