fixed build_source validation in custom git trigger
This commit is contained in:
parent
6ed5235dfd
commit
3fb4d0750b
2 changed files with 19 additions and 1 deletions
|
@ -47,6 +47,23 @@ describe("ManageTriggerComponent", () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe("checkBuildSource", () => {
|
||||
|
||||
it("sets selected repository full name if given build source matches regex pattern", () => {
|
||||
const buildSource: string = "git@somegithost.net:user/repo.git";
|
||||
component.checkBuildSource(buildSource);
|
||||
|
||||
expect(component.local.selectedRepository.full_name).toEqual(buildSource);
|
||||
});
|
||||
|
||||
it("sets selected repository full name to null if given build source does not match regex pattern", () => {
|
||||
const buildSource: string = "a_randomstring";
|
||||
component.checkBuildSource(buildSource);
|
||||
|
||||
expect(component.local.selectedRepository.full_name).toBe(null);
|
||||
});
|
||||
});
|
||||
|
||||
describe("getTriggerIcon", () => {
|
||||
|
||||
beforeEach(() => {
|
||||
|
|
Reference in a new issue