Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,18 @@ describe("calcite-date-picker-month-header", () => {
const yearInput = await page.find(`calcite-date-picker-month-header >>> input`);
expect(yearInput.getAttribute("aria-label")).toBe(messages.year);
});

it("displays the correct scale for actions", async () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you try adding this as a browser test instead? We should prioritize browser mode for new tests to help move away from Puppeteer E2E tests.

This can be done as a follow up.

const datePickerMonthHeader = await page.find("calcite-date-picker-month-header");
const [prev, next] = await findAll(page, "calcite-date-picker-month-header >>> .chevron");

const scales = ["s", "m", "l"] as const;

for (const scale of scales) {
datePickerMonthHeader.setProperty("scale", scale);
await page.waitForChanges();
expect(await prev.getProperty("scale")).toBe(scale);
expect(await next.getProperty("scale")).toBe(scale);
}
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ export class DatePickerMonthHeader extends LitElement {
onKeyDown={isDirectionRight ? this.nextMonthKeydown : this.prevMonthKeydown}
ref={isDirectionRight ? this.nextMonthActionRef : this.prevMonthActionRef}
role="button"
scale={this.scale === "l" ? "l" : "m"}
scale={this.scale}
text={isDirectionRight ? this.messages.nextMonth : this.messages.prevMonth}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ localized.parameters = {
};

export const widthSetToBreakpoints_TestOnly = (): string =>
createBreakpointStories(html`<calcite-date-picker scale="{scale}" value="2000-11-27"></calcite-date-picker>`);
createBreakpointStories(html`<calcite-date-picker scale="s" value="2000-11-27"></calcite-date-picker>`);

export const defaultWidthAllScales_TestOnly = (): string => html`
<calcite-date-picker scale="s" value="2000-11-27"></calcite-date-picker>
Expand Down
Loading