-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: revisit create policies for DevWorkspace mode
Try to open again a workspace by default Creates a new workspace if specify ?new at the end of short URL Note: it applies only for DevWorkspaces fix eclipse-che/che#20867
- Loading branch information
Showing
4 changed files
with
117 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
packages/dashboard-frontend/src/services/helpers/__tests__/location.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright (c) 2018-2021 Red Hat, Inc. | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
*/ | ||
|
||
import { buildFactoryLoaderLocation } from '../location'; | ||
|
||
describe('Location test', () => { | ||
test('new policy', () => { | ||
const result = buildFactoryLoaderLocation( | ||
'https://github.com/che-samples/java-spring-petclinic/tree/devfilev2?new=', | ||
); | ||
expect(result.search).toBe( | ||
'?url=https%3A%2F%2Fgithub.com%2Fche-samples%2Fjava-spring-petclinic%2Ftree%2Fdevfilev2&policies.create=perclick', | ||
); | ||
}); | ||
|
||
test('che-editor parameter', () => { | ||
const result = buildFactoryLoaderLocation( | ||
'https://github.com/che-samples/java-spring-petclinic/tree/devfilev2?che-editor=che-incubator/checode/insiders', | ||
); | ||
expect(result.search).toBe( | ||
'?url=https%3A%2F%2Fgithub.com%2Fche-samples%2Fjava-spring-petclinic%2Ftree%2Fdevfilev2&che-editor=che-incubator/checode/insiders', | ||
); | ||
}); | ||
|
||
test('devfilePath parameter', () => { | ||
const result = buildFactoryLoaderLocation( | ||
'https://github.com/che-samples/java-spring-petclinic/tree/devfilev2?devfilePath=devfilev2.yaml', | ||
); | ||
expect(result.search).toBe( | ||
'?url=https%3A%2F%2Fgithub.com%2Fche-samples%2Fjava-spring-petclinic%2Ftree%2Fdevfilev2&override.devfileFilename=devfilev2.yaml', | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters