Skip to content

Commit

Permalink
use button id to identify if token is available
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmaLRussell committed Oct 5, 2023
1 parent 2ff083f commit 4ba2ab7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions app/client/src/components/GenerateMicroreactURL.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<div>
<button
v-if='!microreactToken'
id="generate-microreact-url-no-token-btn"
@click='showModal()'
class='btn btn-block btn-standard btn-download'
>
Expand All @@ -11,6 +12,7 @@

<button
v-if='tokenAvailable'
id="generate-microreact-url-token-btn"
@click='buildMicroreactURL({cluster, token: microreactToken})'
class='btn btn-block btn-standard btn-download'
>
Expand Down
6 changes: 3 additions & 3 deletions app/client/tests/e2e/LoggedIn.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ test.describe("Logged in Tests", () => {
// Expect download buttons and button to generate microreact URL to appear
await expectDownloadButtons("6930_8_13.fa", page);

// Token will be saved for user after first run of the test
const tokenAvailable = await page.isVisible("#generate-microreact-url-token-btn");
await page.click("text=Generate Microreact URL");

// Token will be saved for user after first run of the test
const modal = await page.isVisible(".modalFlex");
if (modal) {
if (!tokenAvailable) {
await expect(page.locator(".modalFlex")).toContainText("No token submitted yet");
await expect(page.locator(".modalFlex .btn")).toContainText("Save token");
// after submitting microreact token, button turns into link to microreact.org
Expand Down

0 comments on commit 4ba2ab7

Please sign in to comment.