Merge remote-tracking branch 'origin/master' into dev

This commit is contained in:
Blake Blackshear 2022-11-17 07:08:22 -06:00
commit cc27c94e03
3 changed files with 47 additions and 3 deletions

View File

@ -200,12 +200,25 @@ ${Object.keys(objectMaskPoints)
<div className="flex-col space-y-4 p-2 px-4"> <div className="flex-col space-y-4 p-2 px-4">
<Heading size="2xl">{camera} mask & zone creator</Heading> <Heading size="2xl">{camera} mask & zone creator</Heading>
<Card
content={
<div>
<p>This tool can help you create masks & zones for your {camera} camera.</p>
<ul>
<li>Click to add a point.</li>
<li>Click and hold on an existing point to move it.</li>
<li>Right-Click on an existing point to delete it.</li>
</ul>
</div>
}
header="Instructions"
/>
<Card <Card
content={ content={
<p> <p>
This tool can help you create masks & zones for your {camera} camera. When done, copy each mask When done, copy each mask configuration into your <code className="font-mono">config.yml</code> file
configuration into your <code className="font-mono">config.yml</code> file restart your Frigate instance to restart your Frigate instance to save your changes.
save your changes.
</p> </p>
} }
header="Warning" header="Warning"

View File

@ -54,6 +54,10 @@ export default function Recording({ camera, date, hour = '00', minute = '00', se
const selectedDayRecordingData = recordingsSummary.find((s) => !date || s.day === date); const selectedDayRecordingData = recordingsSummary.find((s) => !date || s.day === date);
if (!selectedDayRecordingData) {
return [];
}
const [year, month, day] = selectedDayRecordingData.day.split('-'); const [year, month, day] = selectedDayRecordingData.day.split('-');
return selectedDayRecordingData.hours return selectedDayRecordingData.hours
.map((h) => { .map((h) => {

View File

@ -0,0 +1,27 @@
import { h } from 'preact';
import * as CameraImage from '../../components/CameraImage';
import * as Mqtt from '../../api/mqtt';
import Cameras from '../Cameras';
import { render, screen, waitForElementToBeRemoved } from 'testing-library';
describe('Recording Route', () => {
beforeEach(() => {
vi.spyOn(CameraImage, 'default').mockImplementation(() => <div data-testid="camera-image" />);
vi.spyOn(Mqtt, 'useMqtt').mockImplementation(() => ({ value: { payload: 'OFF' }, send: jest.fn() }));
});
test('shows an ActivityIndicator if not yet loaded', async () => {
render(<Cameras />);
expect(screen.queryByLabelText('Loading…')).toBeInTheDocument();
});
test('shows no recordings warning', async () => {
render(<Cameras />);
await waitForElementToBeRemoved(() => screen.queryByLabelText('Loading…'));
expect(screen.queryAllByText('No Recordings Found')).toHaveLength(0);
});
});