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 55b6e1b
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 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();

Check failure on line 126 in packages/dashboard-frontend/src/services/factory-location-adapter/__tests__/factoryLocationAdapter.spec.ts

View workflow job for this annotation

GitHub Actions / build-and-test (20.x)

Delete `··`
});
});

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 55b6e1b

Please sign in to comment.