From b1103a9554c5593c065466d1e289db2680cf2993 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Tue, 7 Jun 2022 17:36:46 +0200
Subject: chore: add a label to progress bar

The progress element is a form element, so a label is required to be
accessible. Since I'm not using it without label, I transform the
optional info parameter to a mandatory label parameter.
---
 src/components/atoms/loaders/progress-bar.test.tsx | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

(limited to 'src/components/atoms/loaders/progress-bar.test.tsx')

diff --git a/src/components/atoms/loaders/progress-bar.test.tsx b/src/components/atoms/loaders/progress-bar.test.tsx
index 3d32feb..bb28f41 100644
--- a/src/components/atoms/loaders/progress-bar.test.tsx
+++ b/src/components/atoms/loaders/progress-bar.test.tsx
@@ -1,9 +1,20 @@
 import { render, screen } from '@tests/utils';
 import ProgressBar from './progress-bar';
+import { current, id, label, max, min } from './progress-bar.fixture';
 
 describe('ProgressBar', () => {
   it('renders a progress bar', () => {
-    render(<ProgressBar min={0} max={50} current={10} />);
-    expect(screen.getByRole('progressbar')).toBeInTheDocument();
+    render(
+      <ProgressBar
+        id={id}
+        label={label}
+        min={min}
+        max={max}
+        current={current}
+      />
+    );
+    expect(
+      screen.getByRole('progressbar', { name: label })
+    ).toBeInTheDocument();
   });
 });
-- 
cgit v1.2.3

