Merge artifacts. These are no longer necessary.
This commit is contained in:
@ -1,30 +0,0 @@
|
||||
import { $, expect } from "@wdio/globals";
|
||||
|
||||
import { html, render } from "lit";
|
||||
|
||||
import "../Alert.js";
|
||||
import { Level } from "../Alert.js";
|
||||
|
||||
describe("ak-alert", () => {
|
||||
it("should render an alert with the enum", async () => {
|
||||
render(html`<ak-alert level=${Level.Info}>This is an alert</ak-alert>`, document.body);
|
||||
|
||||
await expect(await $("ak-alert").$(">>>div")).not.toHaveElementClass("pf-m-inline");
|
||||
await expect(await $("ak-alert").$(">>>div")).toHaveElementClass("pf-c-alert");
|
||||
await expect(await $("ak-alert").$(">>>div")).toHaveElementClass("pf-m-info");
|
||||
await expect(await $("ak-alert").$(">>>.pf-c-alert__title")).toHaveText("This is an alert");
|
||||
});
|
||||
|
||||
it("should render an alert with the attribute", async () => {
|
||||
render(html`<ak-alert level="info">This is an alert</ak-alert>`, document.body);
|
||||
await expect(await $("ak-alert").$(">>>div")).toHaveElementClass("pf-m-info");
|
||||
await expect(await $("ak-alert").$(">>>.pf-c-alert__title")).toHaveText("This is an alert");
|
||||
});
|
||||
|
||||
it("should render an alert with an inline class and the default level", async () => {
|
||||
render(html`<ak-alert inline>This is an alert</ak-alert>`, document.body);
|
||||
await expect(await $("ak-alert").$(">>>div")).toHaveElementClass("pf-m-warning");
|
||||
await expect(await $("ak-alert").$(">>>div")).toHaveElementClass("pf-m-inline");
|
||||
await expect(await $("ak-alert").$(">>>.pf-c-alert__title")).toHaveText("This is an alert");
|
||||
});
|
||||
});
|
@ -1,33 +0,0 @@
|
||||
import { ensureCSSStyleSheet } from "@goauthentik/elements/utils/ensureCSSStyleSheet.js";
|
||||
import { $, expect } from "@wdio/globals";
|
||||
|
||||
import { TemplateResult, html, render as litRender } from "lit";
|
||||
|
||||
import AKGlobal from "@goauthentik/common/styles/authentik.css";
|
||||
import PFBase from "@patternfly/patternfly/patternfly-base.css";
|
||||
|
||||
import "../Divider.js";
|
||||
|
||||
const render = (body: TemplateResult) => {
|
||||
document.adoptedStyleSheets = [
|
||||
...document.adoptedStyleSheets,
|
||||
ensureCSSStyleSheet(PFBase),
|
||||
ensureCSSStyleSheet(AKGlobal),
|
||||
];
|
||||
return litRender(body, document.body);
|
||||
};
|
||||
|
||||
describe("ak-divider", () => {
|
||||
it("should render the divider", async () => {
|
||||
render(html`<ak-divider></ak-divider>`);
|
||||
const empty = await $("ak-divider");
|
||||
await expect(empty).toExist();
|
||||
});
|
||||
|
||||
it("should render the divider with the specified text", async () => {
|
||||
render(html`<ak-divider><span>Your Message Here</span></ak-divider>`);
|
||||
const span = await $("ak-divider").$("span");
|
||||
await expect(span).toExist();
|
||||
await expect(span).toHaveText("Your Message Here");
|
||||
});
|
||||
});
|
@ -1,63 +0,0 @@
|
||||
import { ensureCSSStyleSheet } from "@goauthentik/elements/utils/ensureCSSStyleSheet.js";
|
||||
import { $, expect } from "@wdio/globals";
|
||||
|
||||
import { msg } from "@lit/localize";
|
||||
import { TemplateResult, html, render as litRender } from "lit";
|
||||
|
||||
import AKGlobal from "@goauthentik/common/styles/authentik.css";
|
||||
import PFBase from "@patternfly/patternfly/patternfly-base.css";
|
||||
|
||||
import "../EmptyState.js";
|
||||
|
||||
const render = (body: TemplateResult) => {
|
||||
document.adoptedStyleSheets = [
|
||||
...document.adoptedStyleSheets,
|
||||
ensureCSSStyleSheet(PFBase),
|
||||
ensureCSSStyleSheet(AKGlobal),
|
||||
];
|
||||
return litRender(body, document.body);
|
||||
};
|
||||
|
||||
describe("ak-empty-state", () => {
|
||||
it("should render the default loader", async () => {
|
||||
render(html`<ak-empty-state ?loading=${true} header=${msg("Loading")}> </ak-empty-state>`);
|
||||
|
||||
const empty = await $("ak-empty-state").$(">>>.pf-c-empty-state__icon");
|
||||
await expect(empty).toExist();
|
||||
|
||||
const header = await $("ak-empty-state").$(">>>.pf-c-title");
|
||||
await expect(header).toHaveText("Loading");
|
||||
});
|
||||
|
||||
it("should handle standard boolean", async () => {
|
||||
render(html`<ak-empty-state loading header=${msg("Loading")}> </ak-empty-state>`);
|
||||
|
||||
const empty = await $("ak-empty-state").$(">>>.pf-c-empty-state__icon");
|
||||
await expect(empty).toExist();
|
||||
|
||||
const header = await $("ak-empty-state").$(">>>.pf-c-title");
|
||||
await expect(header).toHaveText("Loading");
|
||||
});
|
||||
|
||||
it("should render a static empty state", async () => {
|
||||
render(html`<ak-empty-state header=${msg("No messages found")}> </ak-empty-state>`);
|
||||
|
||||
const empty = await $("ak-empty-state").$(">>>.pf-c-empty-state__icon");
|
||||
await expect(empty).toExist();
|
||||
await expect(empty).toHaveClass("fa-question-circle");
|
||||
|
||||
const header = await $("ak-empty-state").$(">>>.pf-c-title");
|
||||
await expect(header).toHaveText("No messages found");
|
||||
});
|
||||
|
||||
it("should render a slotted message", async () => {
|
||||
render(
|
||||
html`<ak-empty-state header=${msg("No messages found")}>
|
||||
<p slot="body">Try again with a different filter</p>
|
||||
</ak-empty-state>`,
|
||||
);
|
||||
|
||||
const message = await $("ak-empty-state").$(">>>.pf-c-empty-state__body").$(">>>p");
|
||||
await expect(message).toHaveText("Try again with a different filter");
|
||||
});
|
||||
});
|
@ -1,52 +0,0 @@
|
||||
import { ensureCSSStyleSheet } from "@goauthentik/elements/utils/ensureCSSStyleSheet.js";
|
||||
import { $, expect } from "@wdio/globals";
|
||||
|
||||
import { TemplateResult, html, render as litRender } from "lit";
|
||||
|
||||
import AKGlobal from "@goauthentik/common/styles/authentik.css";
|
||||
import PFBase from "@patternfly/patternfly/patternfly-base.css";
|
||||
|
||||
import "../Expand.js";
|
||||
|
||||
const render = (body: TemplateResult) => {
|
||||
document.adoptedStyleSheets = [
|
||||
...document.adoptedStyleSheets,
|
||||
ensureCSSStyleSheet(PFBase),
|
||||
ensureCSSStyleSheet(AKGlobal),
|
||||
];
|
||||
return litRender(body, document.body);
|
||||
};
|
||||
|
||||
describe("ak-expand", () => {
|
||||
it("should render the expansion content hidden by default", async () => {
|
||||
render(html`<ak-expand><p>This is the expanded text</p></ak-expand>`);
|
||||
const text = await $("ak-expand").$(">>>.pf-c-expandable-section__content");
|
||||
await expect(text).not.toBeDisplayed();
|
||||
});
|
||||
|
||||
it("should render the expansion content visible on demand", async () => {
|
||||
render(html`<ak-expand expanded><p>This is the expanded text</p></ak-expand>`);
|
||||
const paragraph = await $("ak-expand").$(">>>p");
|
||||
await expect(paragraph).toExist();
|
||||
await expect(paragraph).toBeDisplayed();
|
||||
await expect(paragraph).toHaveText("This is the expanded text");
|
||||
});
|
||||
|
||||
it("should respond to the click event", async () => {
|
||||
render(html`<ak-expand><p>This is the expanded text</p></ak-expand>`);
|
||||
let content = await $("ak-expand").$(">>>.pf-c-expandable-section__content");
|
||||
await expect(content).toExist();
|
||||
await expect(content).not.toBeDisplayed();
|
||||
const control = await $("ak-expand").$(">>>button");
|
||||
|
||||
await control.click();
|
||||
content = await $("ak-expand").$(">>>.pf-c-expandable-section__content");
|
||||
await expect(content).toExist();
|
||||
await expect(content).toBeDisplayed();
|
||||
|
||||
await control.click();
|
||||
content = await $("ak-expand").$(">>>.pf-c-expandable-section__content");
|
||||
await expect(content).toExist();
|
||||
await expect(content).not.toBeDisplayed();
|
||||
});
|
||||
});
|
@ -1,53 +0,0 @@
|
||||
import { $, expect } from "@wdio/globals";
|
||||
|
||||
import { html, render } from "lit";
|
||||
|
||||
import "../Label.js";
|
||||
import { PFColor } from "../Label.js";
|
||||
|
||||
describe("ak-label", () => {
|
||||
it("should render a label with the enum", async () => {
|
||||
render(html`<ak-label color=${PFColor.Red}>This is a label</ak-label>`, document.body);
|
||||
await expect(await $("ak-label").$(">>>span.pf-c-label")).toHaveElementClass("pf-c-label");
|
||||
await expect(await $("ak-label").$(">>>span.pf-c-label")).not.toHaveElementClass(
|
||||
"pf-m-compact",
|
||||
);
|
||||
await expect(await $("ak-label").$(">>>span.pf-c-label")).toHaveElementClass("pf-m-red");
|
||||
await expect(await $("ak-label").$(">>>i.fas")).toHaveElementClass("fa-times");
|
||||
await expect(await $("ak-label").$(">>>.pf-c-label__content")).toHaveText(
|
||||
"This is a label",
|
||||
);
|
||||
});
|
||||
|
||||
it("should render a label with the attribute", async () => {
|
||||
render(html`<ak-label color="success">This is a label</ak-label>`, document.body);
|
||||
await expect(await $("ak-label").$(">>>span.pf-c-label")).toHaveElementClass("pf-m-green");
|
||||
await expect(await $("ak-label").$(">>>.pf-c-label__content")).toHaveText(
|
||||
"This is a label",
|
||||
);
|
||||
});
|
||||
|
||||
it("should render a compart label with the default level", async () => {
|
||||
render(html`<ak-label compact>This is a label</ak-label>`, document.body);
|
||||
await expect(await $("ak-label").$(">>>span.pf-c-label")).toHaveElementClass("pf-m-grey");
|
||||
await expect(await $("ak-label").$(">>>span.pf-c-label")).toHaveElementClass(
|
||||
"pf-m-compact",
|
||||
);
|
||||
await expect(await $("ak-label").$(">>>i.fas")).toHaveElementClass("fa-info-circle");
|
||||
await expect(await $("ak-label").$(">>>.pf-c-label__content")).toHaveText(
|
||||
"This is a label",
|
||||
);
|
||||
});
|
||||
|
||||
it("should render a compact label with an icon and the default level", async () => {
|
||||
render(html`<ak-label compact icon="fa-coffee">This is a label</ak-label>`, document.body);
|
||||
await expect(await $("ak-label").$(">>>span.pf-c-label")).toHaveElementClass("pf-m-grey");
|
||||
await expect(await $("ak-label").$(">>>span.pf-c-label")).toHaveElementClass(
|
||||
"pf-m-compact",
|
||||
);
|
||||
await expect(await $("ak-label").$(">>>.pf-c-label__content")).toHaveText(
|
||||
"This is a label",
|
||||
);
|
||||
await expect(await $("ak-label").$(">>>i.fas")).toHaveElementClass("fa-coffee");
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user