Skip to content

Commit

Permalink
Add tests specifically for FactoryLocationAdapter.isHttpLocation
Browse files Browse the repository at this point in the history
Signed-off-by: David Kwon <dakwon@redhat.com>
  • Loading branch information
dkwon17 committed Oct 2, 2023
1 parent 83cdfa6 commit e49d3b3
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,22 @@ describe('FactoryLocationAdapter Service', () => {
});
});

describe('test FactoryLocationAdapter.isHttpLocation', () => {
it('should return true for https git url', () => {
const location = 'https://git-test.com/dummy.git';
expect(FactoryLocationAdapter.isHttpLocation(location)).toBeTruthy();
});
it('should return true when git remote specified', () => {
const location = 'https://git-test.com/dummy.git?remotes={https://git-test.com/remote.git}';
expect(FactoryLocationAdapter.isHttpLocation(location)).toBeTruthy();
});
it('should return true when git remotes and remote names are specified', () => {
const location =
'https://git-test.com/dummy.git?remotes={{origin,https://git-test.com/origin.git},{upstream,https://git-test.com/upstream.git}}';
expect(FactoryLocationAdapter.isHttpLocation(location)).toBeTruthy();
});
});

it('should return factory reference without oauth params', () => {
const fullPathUrl = 'https://github.com/eclipse-che/che-dashboard.git';
const oauthParams = 'session_state=63273265623765783252378';
Expand Down

0 comments on commit e49d3b3

Please sign in to comment.