fix: add examples; improve consistency of tests
Signed-off-by: Benjamin Janssens <benji.janssens@gmail.com>
This commit is contained in:
+6
-6
@@ -239,7 +239,7 @@ describe('publish:bitbucketCloud:pull-request', () => {
|
||||
'https://api.bitbucket.org/2.0/repositories/workspace/repo/refs/branches',
|
||||
(req, res, ctx) => {
|
||||
expect(req.headers.get('Authorization')).toBe(
|
||||
`Basic ${btoa('test-user:test-password')}`,
|
||||
'Basic dGVzdC11c2VyOnRlc3QtcGFzc3dvcmQ=',
|
||||
);
|
||||
return res(
|
||||
ctx.status(200),
|
||||
@@ -252,7 +252,7 @@ describe('publish:bitbucketCloud:pull-request', () => {
|
||||
'https://api.bitbucket.org/2.0/repositories/workspace/repo/pullrequests',
|
||||
(req, res, ctx) => {
|
||||
expect(req.headers.get('Authorization')).toBe(
|
||||
`Basic ${btoa('test-user:test-password')}`,
|
||||
'Basic dGVzdC11c2VyOnRlc3QtcGFzc3dvcmQ=',
|
||||
);
|
||||
return res(
|
||||
ctx.status(201),
|
||||
@@ -279,7 +279,7 @@ describe('publish:bitbucketCloud:pull-request', () => {
|
||||
'https://api.bitbucket.org/2.0/repositories/workspace/repo/refs/branches',
|
||||
(req, res, ctx) => {
|
||||
expect(req.headers.get('Authorization')).toBe(
|
||||
`Basic ${btoa('test-user:test-password')}`,
|
||||
'Basic dGVzdC11c2VyOnRlc3QtcGFzc3dvcmQ=',
|
||||
);
|
||||
return res(
|
||||
ctx.status(200),
|
||||
@@ -292,7 +292,7 @@ describe('publish:bitbucketCloud:pull-request', () => {
|
||||
'https://api.bitbucket.org/2.0/repositories/workspace/repo/pullrequests',
|
||||
(req, res, ctx) => {
|
||||
expect(req.headers.get('Authorization')).toBe(
|
||||
`Basic ${btoa('test-user:test-password')}`,
|
||||
'Basic dGVzdC11c2VyOnRlc3QtcGFzc3dvcmQ=',
|
||||
);
|
||||
return res(
|
||||
ctx.status(201),
|
||||
@@ -319,7 +319,7 @@ describe('publish:bitbucketCloud:pull-request', () => {
|
||||
'https://api.bitbucket.org/2.0/repositories/workspace/repo/refs/branches',
|
||||
(req, res, ctx) => {
|
||||
expect(req.headers.get('Authorization')).toBe(
|
||||
`Basic ${btoa('test-user:test-password')}`,
|
||||
'Basic dGVzdC11c2VyOnRlc3QtcGFzc3dvcmQ=',
|
||||
);
|
||||
return res(
|
||||
ctx.status(200),
|
||||
@@ -332,7 +332,7 @@ describe('publish:bitbucketCloud:pull-request', () => {
|
||||
'https://api.bitbucket.org/2.0/repositories/workspace/repo/pullrequests',
|
||||
(req, res, ctx) => {
|
||||
expect(req.headers.get('Authorization')).toBe(
|
||||
`Basic ${btoa('test-user:test-password')}`,
|
||||
'Basic dGVzdC11c2VyOnRlc3QtcGFzc3dvcmQ=',
|
||||
);
|
||||
return res(
|
||||
ctx.status(201),
|
||||
|
||||
+2
-1
@@ -29,6 +29,7 @@ import fetch, { RequestInit, Response } from 'node-fetch';
|
||||
import { Config } from '@backstage/config';
|
||||
import fs from 'fs-extra';
|
||||
import { getAuthorizationHeader } from './helpers';
|
||||
import { examples } from './bitbucketCloudPullRequest.examples';
|
||||
|
||||
const createPullRequest = async (opts: {
|
||||
workspace: string;
|
||||
@@ -244,7 +245,7 @@ export function createPublishBitbucketCloudPullRequestAction(options: {
|
||||
gitAuthorEmail?: string;
|
||||
}>({
|
||||
id: 'publish:bitbucketCloud:pull-request',
|
||||
// examples,
|
||||
examples,
|
||||
schema: {
|
||||
input: {
|
||||
type: 'object',
|
||||
|
||||
Reference in New Issue
Block a user