-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dashboard] fix host value for Git Integrations
if `:` is included, just the preview of the callback URL should be replaced with `_`, but not actual host value.
- Loading branch information
1 parent
31c4178
commit 5a88807
Showing
2 changed files
with
30 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* Copyright (c) 2022 Gitpod GmbH. All rights reserved. | ||
* Licensed under the GNU Affero General Public License (AGPL). | ||
* See License-AGPL.txt in the project root for license information. | ||
*/ | ||
|
||
import { render, fireEvent, screen } from "@testing-library/react"; | ||
import { GitIntegrationModal } from "./Integrations"; | ||
|
||
test.only("should update redirectURL preview", async () => { | ||
render(<GitIntegrationModal mode="new" userId="F00" />); | ||
|
||
fireEvent.change(screen.getByLabelText(/Host/i), { | ||
target: { value: "gitlab.gitpod.io:80" }, | ||
}); | ||
const host = screen.getByLabelText(/Host/i); | ||
// screen.debug(host); | ||
expect((host as HTMLInputElement).value).toEqual("gitlab.gitpod.io:80"); | ||
|
||
const redirectURL = screen.getByLabelText(/Redirect/i); | ||
// screen.debug(redirectURL); | ||
expect((redirectURL as HTMLInputElement).value).toEqual("http://localhost/auth/gitlab.gitpod.io_80/callback"); | ||
}); |
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