Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## unreleased

- An `alert` without `color` uses the info color again, and its `role` attribute no longer starts with a space. ([#1697](https://github.com/sqlpage/SQLPage/issues/1697))
- New `create_new_text` and `no_results_text` properties on `select` fields translate the dropdown texts "Add …" and "No results found". The row that creates a new value is now announced by screen readers when it is the active option. ([#1699](https://github.com/sqlpage/SQLPage/issues/1699))
- The `table` component can fetch and display HTML fragments in selected columns using `embed`.
- New `navbar_toggle_label` property on the `shell` and `close_label` property on the `alert` component, to translate the accessible names of the menu toggle button and of the alert close button. ([#1632](https://github.com/sqlpage/SQLPage/issues/1632))
Expand Down
4 changes: 2 additions & 2 deletions sqlpage/templates/alert.handlebars
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div {{~#if id}} id="{{id}}" {{/if}} class="alert alert-{{default color " info"}} {{class}} {{~#if dismissible}}
alert-dismissible{{/if~}} {{~#if important}} alert-important{{/if~}} " role=" alert">
<div {{~#if id}} id="{{id}}" {{/if}} class="alert alert-{{default color "info"}} {{class}} {{~#if dismissible}}
alert-dismissible{{/if~}} {{~#if important}} alert-important{{/if~}} " role="alert">

{{~#if icon~}}
<div class="icon alert-icon">
Expand Down
2 changes: 2 additions & 0 deletions tests/end-to-end/fixtures/alert-default-color/index.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SELECT 'alert' AS component, 'Default color' AS title, 'No color property.' AS description;
SELECT 'alert' AS component, 'Explicit color' AS title, 'red' AS color;
9 changes: 9 additions & 0 deletions tests/end-to-end/fixtures/alert-default-color/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { expect, test } from "../../fixture.ts";

test("an alert without color uses the info color", async ({ page }) => {
await expect(page.locator(".alert").first()).toHaveClass(/\balert-info\b/);
});

test("the role attribute of every alert is exactly alert", async ({ page }) => {
await expect(page.locator('.alert[role="alert"]')).toHaveCount(2);
});
Loading