${!this.indeterminate
diff --git a/src/components/progress-ring/progress-ring.test.ts b/src/components/progress-ring/progress-ring.test.ts
new file mode 100644
index 000000000..db316c293
--- /dev/null
+++ b/src/components/progress-ring/progress-ring.test.ts
@@ -0,0 +1,68 @@
+import { expect, fixture, html } from '@open-wc/testing';
+
+import '../../../dist/shoelace.js';
+import type SlProgressRing from './progress-ring';
+
+describe('', () => {
+ let el: SlProgressRing;
+
+ describe('when provided just a value parameter', async () => {
+ before(async () => {
+ el = await fixture(html``);
+ });
+
+ it('should render a component that passes accessibility test.', async () => {
+ await expect(el).to.be.accessible();
+ });
+ });
+
+ describe('when provided a title, and value parameter', async () => {
+ let base: HTMLDivElement;
+
+ before(async () => {
+ el = await fixture(
+ html``
+ );
+ base = el.shadowRoot?.querySelector('[part="base"]') as HTMLDivElement;
+ });
+
+ it('should render a component that passes accessibility test.', async () => {
+ await expect(el).to.be.accessible();
+ });
+
+ it('uses the value parameter on the base, as aria-valuenow', async () => {
+ expect(base).attribute('aria-valuenow', '25');
+ });
+
+ it('translates the value parameter to a percentage, and uses translation on the base, as percentage css variable', async () => {
+ expect(base).attribute('style', '--percentage: 0.25');
+ });
+ });
+
+ describe('when provided a ariaLabel, and value parameter', async () => {
+ before(async () => {
+ el = await fixture(
+ html``
+ );
+ });
+
+ it('should render a component that passes accessibility test.', async () => {
+ await expect(el).to.be.accessible();
+ });
+ });
+
+ describe('when provided a ariaLabelledBy, and value parameter', async () => {
+ before(async () => {
+ el = await fixture(
+ html`
+
+
+ `
+ );
+ });
+
+ it('should render a component that passes accessibility test.', async () => {
+ await expect(el).to.be.accessible();
+ });
+ });
+});
diff --git a/src/components/progress-ring/progress-ring.ts b/src/components/progress-ring/progress-ring.ts
index 1eeccd65a..11ab3b609 100644
--- a/src/components/progress-ring/progress-ring.ts
+++ b/src/components/progress-ring/progress-ring.ts
@@ -1,5 +1,6 @@
import { LitElement, html } from 'lit';
import { customElement, property, query, state } from 'lit/decorators.js';
+import { ifDefined } from 'lit/directives/if-defined.js';
import styles from './progress-ring.styles';
/**
@@ -27,6 +28,9 @@ export default class SlProgressRing extends LitElement {
/** The current progress, 0 to 100. */
@property({ type: Number, reflect: true }) value = 0;
+ /** The progress ring's aria label. */
+ @property() label = 'Progress'; // TODO - i18n
+
updated(changedProps: Map) {
super.updated(changedProps);
@@ -50,6 +54,7 @@ export default class SlProgressRing extends LitElement {
part="base"
class="progress-ring"
role="progressbar"
+ aria-label=${ifDefined(this.label)}
aria-valuemin="0"
aria-valuemax="100"
aria-valuenow="${this.value}"