Skip to content

Commit

Permalink
Merge branch 'main' into jeffdaley/explore-projects
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffdaley committed Sep 26, 2023
2 parents 2ad8449 + d0d6c51 commit bcf6f46
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions web/tests/integration/components/document/sidebar/header-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,35 +59,35 @@ module("Integration | Component | document/sidebar/header", function (hooks) {
assert.dom(googleDocsLinkSelector).exists("external link shown");
assert
.dom(dashboardLinkSelector)
.hasText("Dashboard", "the dashboard text link is shown");
.hasText("Hermes", "the hermes link is shown");

assert
.dom(dashboardLinkSelector + " .flight-icon")
.hasAttribute("data-test-icon", "arrow-left", "back arrow is shown");
.hasAttribute("data-test-icon", "hashicorp", "hashicorp logo is shown");
assert
.dom(toggleButtonSelector)
.doesNotHaveAttribute(
"data-test-is-collapsed",
"the sidebar is not collapsed"
"the sidebar is not collapsed",
);
assert
.dom(toggleButtonSelector + " .flight-icon")
.hasAttribute(
"data-test-icon",
"sidebar-hide",
"the collapse-sidebar icon is shown"
"the collapse-sidebar icon is shown",
);

const externalLinkHref = htmlElement(googleDocsLinkSelector).getAttribute(
"href"
"href",
);
const urlStart = "https://docs.google.com/document/d/";
const docID = this.document.objectID;

assert.equal(
externalLinkHref,
urlStart + docID,
"Google Docs link is correct"
"Google Docs link is correct",
);

this.server.schema.document.first().update({ isDraft: true });
Expand All @@ -107,21 +107,14 @@ module("Integration | Component | document/sidebar/header", function (hooks) {
.hasAttribute(
"data-test-icon",
"sidebar-show",
"the expand-sidebar icon is shown"
"the expand-sidebar icon is shown",
);

assert
.dom(dashboardLinkSelector)
.doesNotHaveTextContaining(
"Dashboard",
"dashboard text is not shown when sidebar is collapsed"
);
assert
.dom(dashboardLinkSelector + " .flight-icon")
.hasAttribute(
"data-test-icon",
"hashicorp",
"the hashicorp logo becomes the dashboard link when the sidebar is collapsed"
"Hermes",
"hermes text is not shown when sidebar is collapsed",
);

this.set("userHasScrolled", true);
Expand Down

0 comments on commit bcf6f46

Please sign in to comment.