branchName: undefined,
calledPort: MOCK_IDES[0].port,
issueKey: MOCK_ISSUE_KEY,
- login: 'login-1',
projectKey: MOCK_PROJECT_KEY,
pullRequestID: undefined,
tokenName: undefined,
branchName: undefined,
calledPort: MOCK_IDES[1].port,
issueKey: MOCK_ISSUE_KEY,
- login: 'login-1',
projectKey: MOCK_PROJECT_KEY,
pullRequestID: undefined,
tokenName: 'token name',
describe('openIssue', () => {
it('should send the correct request to the IDE to open an issue', async () => {
let branchName: string | undefined = undefined;
- let login: string | undefined = undefined;
let pullRequestID: string | undefined = undefined;
let tokenName: string | undefined = undefined;
let tokenValue: string | undefined = undefined;
// eslint-disable-next-line jest/no-conditional-in-test
expect(calledUrl.searchParams.get('pullRequest') ?? undefined).toStrictEqual(pullRequestID);
// eslint-disable-next-line jest/no-conditional-in-test
- expect(calledUrl.searchParams.get('login') ?? undefined).toStrictEqual(login);
- // eslint-disable-next-line jest/no-conditional-in-test
expect(calledUrl.searchParams.get('tokenName') ?? undefined).toStrictEqual(tokenName);
// eslint-disable-next-line jest/no-conditional-in-test
expect(calledUrl.searchParams.get('tokenValue') ?? undefined).toStrictEqual(tokenValue);
pullRequestID = 'pr-1';
await testWith({ pullRequestID });
- login = 'login-1';
tokenName = 'token-name';
tokenValue = 'token-value';
- await testWith({ login, tokenName, tokenValue });
+ await testWith({ tokenName, tokenValue });
});
});
branchName,
calledPort,
issueKey,
- login,
projectKey,
pullRequestID,
tokenName,
branchName?: string;
calledPort: number;
issueKey: string;
- login?: string;
projectKey: string;
pullRequestID?: string;
tokenName?: string;
showUrl.searchParams.set('pullRequest', pullRequestID);
}
- if (login !== undefined && tokenName !== undefined && tokenValue !== undefined) {
- showUrl.searchParams.set('login', login);
+ if (tokenName !== undefined && tokenValue !== undefined) {
showUrl.searchParams.set('tokenName', tokenName);
showUrl.searchParams.set('tokenValue', tokenValue);
}