diff --git a/packages/calcite-components/src/components/alert/alert.e2e.ts b/packages/calcite-components/src/components/alert/alert.e2e.ts index 1c266cf3a89..aad265b893e 100644 --- a/packages/calcite-components/src/components/alert/alert.e2e.ts +++ b/packages/calcite-components/src/components/alert/alert.e2e.ts @@ -1,9 +1,18 @@ import { E2EElement, E2EPage, newE2EPage } from "@stencil/core/testing"; import { html } from "../../../support/formatting"; -import { accessible, hidden, HYDRATED_ATTR, renders, t9n } from "../../tests/commonTests"; +import { accessible, defaults, hidden, HYDRATED_ATTR, renders, t9n } from "../../tests/commonTests"; import { getElementXY } from "../../tests/utils"; import { CSS, DURATIONS } from "./resources"; +describe("defaults", () => { + defaults("calcite-alert", [ + { + propertyName: "autoCloseDuration", + defaultValue: "medium" + } + ]); +}); + describe("calcite-alert", () => { const alertContent = `
Title Text
diff --git a/packages/calcite-components/src/components/alert/alert.tsx b/packages/calcite-components/src/components/alert/alert.tsx index d748079d228..a5c84406150 100644 --- a/packages/calcite-components/src/components/alert/alert.tsx +++ b/packages/calcite-components/src/components/alert/alert.tsx @@ -100,7 +100,7 @@ export class Alert implements OpenCloseComponent, LoadableComponent, T9nComponen @Prop({ reflect: true }) autoClose = false; /** Specifies the duration before the component automatically closes (only use with `autoClose`). */ - @Prop({ reflect: true }) autoCloseDuration: AlertDuration = this.autoClose ? "medium" : null; + @Prop({ reflect: true }) autoCloseDuration: AlertDuration = "medium"; /** Specifies the kind of the component (will apply to top border and icon). */ @Prop({ reflect: true }) kind: Extract<