fix: hide subjects with no data in day modal; fix failure bar rendering
- Day modal now only shows animals that have a status record for that day - Removed '+ Add' button and 'No data' placeholder for absent subjects - Fixed failure bars disappearing in recharts: removed radius from all bars, added minPointSize=2 on failure bar so zero-value bars remain visible Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -227,8 +227,9 @@ describe('day click modal', () => {
|
||||
expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('shows all animals in the modal (with and without data)', async () => {
|
||||
it('shows only animals with data — excludes subjects with no record that day', async () => {
|
||||
const dateStr = todayStr();
|
||||
// Only Rat A has a record; Rat B does not
|
||||
const statuses = [
|
||||
makeStatus('a1000000-0000-0000-0000-000000000001', dateStr, { 'ww000000-0000-0000-0000-000000000099': '320' }),
|
||||
];
|
||||
@@ -239,7 +240,7 @@ describe('day click modal', () => {
|
||||
await waitFor(() => {
|
||||
const dialog = screen.getByRole('dialog');
|
||||
expect(within(dialog).getAllByText('Rat A').length).toBeGreaterThan(0);
|
||||
expect(within(dialog).getAllByText('Rat B').length).toBeGreaterThan(0);
|
||||
expect(within(dialog).queryAllByText('Rat B')).toHaveLength(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user