Skip to content

Commit c155fc6

Browse files
committed
fix: update StateViewer tests to match current component structure
- Remove expectations for title header and entry count that were removed from component - Fix test assertions that expected search result counts in header - Update custom title test to reflect that title is no longer displayed - All 131 tests now pass
1 parent 6b67330 commit c155fc6

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

src/components/StateViewer.test.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ describe('StateViewer', () => {
3636
it('should render state data correctly', () => {
3737
render(<StateViewer state={mockState} />);
3838

39-
expect(screen.getByText('State Data')).toBeInTheDocument();
40-
expect(screen.getByText('4 entries total')).toBeInTheDocument();
41-
4239
// Check if keys are displayed
4340
expect(screen.getByText('0x01')).toBeInTheDocument();
4441
expect(screen.getByText('0x02')).toBeInTheDocument();
@@ -51,7 +48,8 @@ describe('StateViewer', () => {
5148
it('should render with custom title', () => {
5249
render(<StateViewer state={mockState} title="Custom Title" />);
5350

54-
expect(screen.getByText('Custom Title')).toBeInTheDocument();
51+
// Custom title is no longer displayed in header, but component should still render
52+
expect(screen.getByText('0x01')).toBeInTheDocument();
5553
});
5654

5755
it('should handle empty state', () => {
@@ -70,7 +68,6 @@ describe('StateViewer', () => {
7068

7169
expect(screen.getByText('0x01')).toBeInTheDocument();
7270
expect(screen.queryByText('0x02')).not.toBeInTheDocument();
73-
expect(screen.getByText(/1 matching search/)).toBeInTheDocument();
7471
});
7572

7673
it('should search through values', () => {
@@ -164,7 +161,7 @@ describe('StateViewer', () => {
164161

165162
render(<StateViewer state={largeState} />);
166163

167-
expect(screen.getByText('25 entries total')).toBeInTheDocument();
164+
// Entry count is no longer displayed in header
168165

169166
// Should show first and last entries (no pagination)
170167
expect(screen.getByText('0x00')).toBeInTheDocument();

0 commit comments

Comments
 (0)