@popsure/dirty-swan 0.66.20 → 0.66.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -73,4 +73,25 @@ describe('TableContents', () => {
73
73
  expect(screen.queryByText('Section 2')).not.toBeInTheDocument();
74
74
  expect(screen.queryByText('Item 2.1.1')).not.toBeInTheDocument();
75
75
  });
76
+
77
+ it('shows the header row only in the first section when showHeader is set', () => {
78
+ const { container } = render(
79
+ <TableContents showHeader tableData={mockData} title="Table" />
80
+ );
81
+
82
+ const tableHeaders = container.querySelectorAll('thead');
83
+ expect(tableHeaders).toHaveLength(2);
84
+ expect(tableHeaders[0]).not.toHaveClass('sr-only');
85
+ expect(tableHeaders[1]).toHaveClass('sr-only');
86
+ });
87
+
88
+ it('keeps every header row hidden when showHeader is not set', () => {
89
+ const { container } = render(
90
+ <TableContents tableData={mockData} title="Table" />
91
+ );
92
+
93
+ container.querySelectorAll('thead').forEach((tableHeader) => {
94
+ expect(tableHeader).toHaveClass('sr-only');
95
+ });
96
+ });
76
97
  });
@@ -149,7 +149,7 @@ const TableContents = ({
149
149
  }
150
150
  hideColumns={hideColumns}
151
151
  hideRows={sectionHideRows}
152
- hideHeader={!showHeader}
152
+ hideHeader={!showHeader || !isFirstSection}
153
153
  openModal={openModal}
154
154
  title={`${title}${
155
155
  section?.title ? ` - ${section.title}` : ''