Skip to content

Commit 44688b0

Browse files
committed
Lint
1 parent 9887b40 commit 44688b0

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

src/components/accordion/Accordion.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Echoes React
3-
* Copyright (C) 2023-2025 SonarSource SA
3+
* Copyright (C) 2023-2025 SonarSource Sàrl
44
* mailto:info AT sonarsource DOT com
55
*
66
* This program is free software; you can redistribute it and/or

src/components/accordion/__tests__/Accordion-test.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ describe('Accordion - Internal Control (Default)', () => {
3232
);
3333

3434
const details = screen.getByRole('group');
35-
const summary = screen.getByText('Test Header').closest('summary');
35+
const headerText = screen.getByText('Test Header');
3636

3737
expect(details).not.toHaveAttribute('open');
3838

39-
await user.click(summary!);
39+
await user.click(headerText);
4040
expect(details).toHaveAttribute('open');
4141

42-
await user.click(summary!);
42+
await user.click(headerText);
4343
expect(details).not.toHaveAttribute('open');
4444
});
4545
});
@@ -56,7 +56,7 @@ describe('Accordion - External Control', () => {
5656
expect(details).not.toHaveAttribute('open');
5757

5858
rerender(
59-
<Accordion header="Test Header" isOpen={true}>
59+
<Accordion header="Test Header" isOpen>
6060
<div>Test Content</div>
6161
</Accordion>,
6262
);
@@ -72,20 +72,20 @@ describe('Accordion - External Control', () => {
7272
</Accordion>,
7373
);
7474

75-
const summary = screen.getByText('Test Header').closest('summary');
75+
const headerText = screen.getByText('Test Header');
7676

77-
await user.click(summary!);
77+
await user.click(headerText);
7878
expect(onOpenChange).toHaveBeenCalledWith(true);
7979
expect(onOpenChange).toHaveBeenCalledTimes(1);
8080

8181
// Simulate parent updating isOpen
8282
rerender(
83-
<Accordion header="Test Header" isOpen={true} onOpenChange={onOpenChange}>
83+
<Accordion header="Test Header" isOpen onOpenChange={onOpenChange}>
8484
<div>Test Content</div>
8585
</Accordion>,
8686
);
8787

88-
await user.click(summary!);
88+
await user.click(headerText);
8989
expect(onOpenChange).toHaveBeenCalledWith(false);
9090
expect(onOpenChange).toHaveBeenCalledTimes(2);
9191
});
@@ -104,17 +104,17 @@ describe('Accordion - External Control', () => {
104104
const { user } = render(<FullyControlledAccordion />);
105105

106106
const details = screen.getByRole('group');
107-
const summary = screen.getByText('Test Header').closest('summary');
107+
const headerText = screen.getByText('Test Header');
108108

109109
// Initially closed
110110
expect(details).not.toHaveAttribute('open');
111111

112112
// Click to open
113-
await user.click(summary!);
113+
await user.click(headerText);
114114
expect(details).toHaveAttribute('open');
115115

116116
// Click to close
117-
await user.click(summary!);
117+
await user.click(headerText);
118118
expect(details).not.toHaveAttribute('open');
119119
});
120120
});

src/components/accordion/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Echoes React
3-
* Copyright (C) 2023-2025 SonarSource SA
3+
* Copyright (C) 2023-2025 SonarSource Sàrl
44
* mailto:info AT sonarsource DOT com
55
*
66
* This program is free software; you can redistribute it and/or

stories/Accordion-stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Echoes React
3-
* Copyright (C) 2023-2025 SonarSource SA
3+
* Copyright (C) 2023-2025 SonarSource Sàrl
44
* mailto:info AT sonarsource DOT com
55
*
66
* This program is free software; you can redistribute it and/or

0 commit comments

Comments
 (0)