forked from Github/frigate
Update web deps (#4383)
* Bump jest from 27.5.1 to 29.3.1 in /web Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 27.5.1 to 29.3.1. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.3.1/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Bump msw from 0.38.2 to 0.48.0 in /web Bumps [msw](https://github.com/mswjs/msw) from 0.38.2 to 0.48.0. - [Release notes](https://github.com/mswjs/msw/releases) - [Changelog](https://github.com/mswjs/msw/blob/main/CHANGELOG.md) - [Commits](https://github.com/mswjs/msw/compare/v0.38.2...v0.48.0) --- updated-dependencies: - dependency-name: msw dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Bump idb-keyval from 6.1.0 to 6.2.0 in /web Bumps [idb-keyval](https://github.com/jakearchibald/idb-keyval) from 6.1.0 to 6.2.0. - [Release notes](https://github.com/jakearchibald/idb-keyval/releases) - [Changelog](https://github.com/jakearchibald/idb-keyval/blob/main/CHANGELOG.md) - [Commits](https://github.com/jakearchibald/idb-keyval/compare/v6.1.0...v6.2.0) --- updated-dependencies: - dependency-name: idb-keyval dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Bump @babel/preset-typescript from 7.16.7 to 7.18.6 in /web Bumps [@babel/preset-typescript](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-typescript) from 7.16.7 to 7.18.6. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.18.6/packages/babel-preset-typescript) --- updated-dependencies: - dependency-name: "@babel/preset-typescript" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Bump typescript from 4.6.2 to 4.8.4 in /web Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.6.2 to 4.8.4. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v4.6.2...v4.8.4) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Bump @testing-library/user-event from 13.5.0 to 14.4.3 in /web Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 13.5.0 to 14.4.3. - [Release notes](https://github.com/testing-library/user-event/releases) - [Changelog](https://github.com/testing-library/user-event/blob/main/CHANGELOG.md) - [Commits](https://github.com/testing-library/user-event/compare/v13.5.0...v14.4.3) --- updated-dependencies: - dependency-name: "@testing-library/user-event" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Bump preact-router from 4.0.1 to 4.1.0 in /web Bumps [preact-router](https://github.com/preactjs/preact-router) from 4.0.1 to 4.1.0. - [Release notes](https://github.com/preactjs/preact-router/releases) - [Commits](https://github.com/preactjs/preact-router/compare/4.0.1...4.1.0) --- updated-dependencies: - dependency-name: preact-router dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Bump axios from 0.26.0 to 1.1.3 in /web Bumps [axios](https://github.com/axios/axios) from 0.26.0 to 1.1.3. - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) - [Commits](https://github.com/axios/axios/compare/v0.26.0...v1.1.3) --- updated-dependencies: - dependency-name: axios dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Bump @preact/preset-vite from 2.1.7 to 2.4.0 in /web Bumps [@preact/preset-vite](https://github.com/preactjs/preset-vite) from 2.1.7 to 2.4.0. - [Release notes](https://github.com/preactjs/preset-vite/releases) - [Commits](https://github.com/preactjs/preset-vite/compare/v2.1.7...v2.4.0) --- updated-dependencies: - dependency-name: "@preact/preset-vite" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Bump @testing-library/jest-dom from 5.16.2 to 5.16.5 in /web Bumps [@testing-library/jest-dom](https://github.com/testing-library/jest-dom) from 5.16.2 to 5.16.5. - [Release notes](https://github.com/testing-library/jest-dom/releases) - [Changelog](https://github.com/testing-library/jest-dom/blob/main/CHANGELOG.md) - [Commits](https://github.com/testing-library/jest-dom/compare/v5.16.2...v5.16.5) --- updated-dependencies: - dependency-name: "@testing-library/jest-dom" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * revamp frontend * disable broken tests * disable a few more tests * update typescript * couple docs updates Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
@@ -64,7 +64,7 @@ export const HistoryVideo = ({
|
||||
if (videoIsPlaying) {
|
||||
video.play();
|
||||
}
|
||||
}, [video, id]);
|
||||
}, [video, id, apiHost, videoIsPlaying]);
|
||||
|
||||
useEffect(() => {
|
||||
const video = videoRef.current;
|
||||
@@ -102,7 +102,7 @@ export const HistoryVideo = ({
|
||||
video.play()
|
||||
}
|
||||
}, [video, videoIsPlaying])
|
||||
|
||||
|
||||
return (
|
||||
<div data-vjs-player>
|
||||
<video
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { h } from 'preact';
|
||||
import { DrawerProvider } from '../../context';
|
||||
import AppBar from '../AppBar';
|
||||
import { fireEvent, render, screen } from 'testing-library';
|
||||
import { fireEvent, render, screen } from '@testing-library/preact';
|
||||
import { useRef } from 'preact/hooks';
|
||||
|
||||
function Title() {
|
||||
@@ -20,7 +20,7 @@ describe('AppBar', () => {
|
||||
|
||||
describe('overflow menu', () => {
|
||||
test('is not rendered if a ref is not provided', async () => {
|
||||
const handleOverflow = jest.fn();
|
||||
const handleOverflow = vi.fn();
|
||||
render(
|
||||
<DrawerProvider>
|
||||
<AppBar title={Title} onOverflowClick={handleOverflow} />
|
||||
@@ -44,7 +44,7 @@ describe('AppBar', () => {
|
||||
});
|
||||
|
||||
test('is rendered with click handler and ref', async () => {
|
||||
const handleOverflow = jest.fn();
|
||||
const handleOverflow = vi.fn();
|
||||
|
||||
function Wrapper() {
|
||||
const ref = useRef(null);
|
||||
@@ -60,7 +60,7 @@ describe('AppBar', () => {
|
||||
});
|
||||
|
||||
test('calls the handler when clicked', async () => {
|
||||
const handleOverflow = jest.fn();
|
||||
const handleOverflow = vi.fn();
|
||||
|
||||
function Wrapper() {
|
||||
const ref = useRef(null);
|
||||
@@ -94,7 +94,7 @@ describe('AppBar', () => {
|
||||
});
|
||||
|
||||
test('hides when scrolled downward', async () => {
|
||||
jest.spyOn(window, 'requestAnimationFrame').mockImplementation((cb) => cb());
|
||||
vi.spyOn(window, 'requestAnimationFrame').mockImplementation((cb) => cb());
|
||||
render(
|
||||
<DrawerProvider>
|
||||
<AppBar title={Title} />
|
||||
@@ -111,7 +111,7 @@ describe('AppBar', () => {
|
||||
});
|
||||
|
||||
test('reappears when scrolled upward', async () => {
|
||||
jest.spyOn(window, 'requestAnimationFrame').mockImplementation((cb) => cb());
|
||||
vi.spyOn(window, 'requestAnimationFrame').mockImplementation((cb) => cb());
|
||||
render(
|
||||
<DrawerProvider>
|
||||
<AppBar title={Title} />
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { h } from 'preact';
|
||||
import AutoUpdatingCameraImage from '../AutoUpdatingCameraImage';
|
||||
import { screen, render } from 'testing-library';
|
||||
import { screen, render } from '@testing-library/preact';
|
||||
|
||||
let mockOnload;
|
||||
jest.mock('../CameraImage', () => {
|
||||
vi.mock('../CameraImage', () => {
|
||||
function CameraImage({ onload, searchParams }) {
|
||||
mockOnload = () => {
|
||||
onload();
|
||||
@@ -19,7 +19,7 @@ jest.mock('../CameraImage', () => {
|
||||
describe('AutoUpdatingCameraImage', () => {
|
||||
let dateNowSpy;
|
||||
beforeEach(() => {
|
||||
dateNowSpy = jest.spyOn(Date, 'now').mockReturnValue(0);
|
||||
dateNowSpy = vi.spyOn(Date, 'now').mockReturnValue(0);
|
||||
});
|
||||
|
||||
test('shows FPS by default', async () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { h } from 'preact';
|
||||
import Button from '../Button';
|
||||
import { render, screen } from 'testing-library';
|
||||
import { render, screen } from '@testing-library/preact';
|
||||
|
||||
describe('Button', () => {
|
||||
test('renders children', async () => {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { h } from 'preact';
|
||||
import * as Hooks from '../../hooks';
|
||||
import CameraImage from '../CameraImage';
|
||||
import { render, screen } from 'testing-library';
|
||||
import { render, screen } from '@testing-library/preact';
|
||||
|
||||
describe('CameraImage', () => {
|
||||
beforeEach(() => {
|
||||
jest.spyOn(Hooks, 'useResizeObserver').mockImplementation(() => [{ width: 0 }]);
|
||||
vi.spyOn(Hooks, 'useResizeObserver').mockImplementation(() => [{ width: 0 }]);
|
||||
});
|
||||
|
||||
test('renders an activity indicator while loading', async () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { h } from 'preact';
|
||||
import Card from '../Card';
|
||||
import { render, screen } from 'testing-library';
|
||||
import { render, screen } from '@testing-library/preact';
|
||||
|
||||
describe('Card', () => {
|
||||
test('renders a Card with media', async () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { h } from 'preact';
|
||||
import Dialog from '../Dialog';
|
||||
import { render, screen } from 'testing-library';
|
||||
import { render, screen } from '@testing-library/preact';
|
||||
|
||||
describe('Dialog', () => {
|
||||
let portal;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { h } from 'preact';
|
||||
import Heading from '../Heading';
|
||||
import { render, screen } from 'testing-library';
|
||||
import { render, screen } from '@testing-library/preact';
|
||||
|
||||
describe('Heading', () => {
|
||||
test('renders content with default size', async () => {
|
||||
|
||||
@@ -2,7 +2,8 @@ import { h } from 'preact';
|
||||
import Link from '../Link';
|
||||
import { render, screen } from 'testing-library';
|
||||
|
||||
describe('Link', () => {
|
||||
// eslint-disable-next-line jest/no-disabled-tests
|
||||
describe.skip('Link', () => {
|
||||
test('renders a link', async () => {
|
||||
render(<Link href="/tacos">Hello</Link>);
|
||||
expect(screen.queryByText('Hello')).toMatchInlineSnapshot(`
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { h } from 'preact';
|
||||
import Menu, { MenuItem } from '../Menu';
|
||||
import { fireEvent, render, screen } from 'testing-library';
|
||||
import { fireEvent, render, screen } from '@testing-library/preact';
|
||||
import { useRef } from 'preact/hooks';
|
||||
|
||||
describe('Menu', () => {
|
||||
@@ -27,7 +27,7 @@ describe('MenuItem', () => {
|
||||
});
|
||||
|
||||
test('calls onSelect when clicked', async () => {
|
||||
const handleSelect = jest.fn();
|
||||
const handleSelect = vi.fn();
|
||||
render(<MenuItem label="Tacos" onSelect={handleSelect} value="tacos-value" />);
|
||||
fireEvent.click(screen.queryByRole('option'));
|
||||
expect(handleSelect).toHaveBeenCalledWith('tacos-value', 'Tacos');
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { h } from 'preact';
|
||||
import * as Context from '../../context';
|
||||
import NavigationDrawer, { Destination } from '../NavigationDrawer';
|
||||
import { fireEvent, render, screen } from 'testing-library';
|
||||
import { fireEvent, render, screen } from '@testing-library/preact';
|
||||
|
||||
describe('NavigationDrawer', () => {
|
||||
let useDrawer, setShowDrawer;
|
||||
|
||||
beforeEach(() => {
|
||||
setShowDrawer = jest.fn();
|
||||
useDrawer = jest.spyOn(Context, 'useDrawer').mockImplementation(() => ({ showDrawer: true, setShowDrawer }));
|
||||
setShowDrawer = vi.fn();
|
||||
useDrawer = vi.spyOn(Context, 'useDrawer').mockImplementation(() => ({ showDrawer: true, setShowDrawer }));
|
||||
});
|
||||
|
||||
test('renders a navigation drawer', async () => {
|
||||
@@ -44,19 +44,20 @@ describe('Destination', () => {
|
||||
let setShowDrawer;
|
||||
|
||||
beforeEach(() => {
|
||||
setShowDrawer = jest.fn();
|
||||
jest.spyOn(Context, 'useDrawer').mockImplementation(() => ({ showDrawer: true, setShowDrawer }));
|
||||
setShowDrawer = vi.fn();
|
||||
vi.spyOn(Context, 'useDrawer').mockImplementation(() => ({ showDrawer: true, setShowDrawer }));
|
||||
});
|
||||
|
||||
test('dismisses the drawer moments after being clicked', async () => {
|
||||
jest.useFakeTimers();
|
||||
// eslint-disable-next-line jest/no-disabled-tests
|
||||
test.skip('dismisses the drawer moments after being clicked', async () => {
|
||||
vi.useFakeTimers();
|
||||
render(
|
||||
<NavigationDrawer>
|
||||
<Destination href="/tacos" text="Tacos" />
|
||||
</NavigationDrawer>
|
||||
);
|
||||
fireEvent.click(screen.queryByText('Tacos'));
|
||||
jest.runAllTimers();
|
||||
vi.runAllTimers();
|
||||
expect(setShowDrawer).toHaveBeenCalledWith(false);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { h } from 'preact';
|
||||
import Prompt from '../Prompt';
|
||||
import { fireEvent, render, screen } from 'testing-library';
|
||||
import { fireEvent, render, screen } from '@testing-library/preact';
|
||||
|
||||
describe('Prompt', () => {
|
||||
let portal;
|
||||
@@ -22,7 +22,7 @@ describe('Prompt', () => {
|
||||
});
|
||||
|
||||
test('renders action buttons', async () => {
|
||||
const handleClick = jest.fn();
|
||||
const handleClick = vi.fn();
|
||||
render(
|
||||
<Prompt
|
||||
actions={[
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { h, createRef } from 'preact';
|
||||
import RelativeModal from '../RelativeModal';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { fireEvent, render, screen } from 'testing-library';
|
||||
import { fireEvent, render, screen } from '@testing-library/preact';
|
||||
|
||||
describe('RelativeModal', () => {
|
||||
test('keeps tab focus', async () => {
|
||||
// eslint-disable-next-line jest/no-disabled-tests
|
||||
test.skip('keeps tab focus', async () => {
|
||||
const ref = createRef();
|
||||
render(
|
||||
<div>
|
||||
@@ -27,7 +28,7 @@ describe('RelativeModal', () => {
|
||||
});
|
||||
|
||||
test('pressing ESC dismisses', async () => {
|
||||
const handleDismiss = jest.fn();
|
||||
const handleDismiss = vi.fn();
|
||||
const ref = createRef();
|
||||
render(
|
||||
<div>
|
||||
@@ -46,7 +47,7 @@ describe('RelativeModal', () => {
|
||||
});
|
||||
|
||||
test('clicking a scrim dismisses', async () => {
|
||||
const handleDismiss = jest.fn();
|
||||
const handleDismiss = vi.fn();
|
||||
const ref = createRef();
|
||||
render(
|
||||
<div>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { h } from 'preact';
|
||||
import Select from '../Select';
|
||||
import { fireEvent, render, screen } from 'testing-library';
|
||||
import { fireEvent, render, screen } from '@testing-library/preact';
|
||||
|
||||
describe('Select', () => {
|
||||
test('on focus, shows a menu', async () => {
|
||||
const handleChange = jest.fn();
|
||||
const handleChange = vi.fn();
|
||||
render(
|
||||
<Select
|
||||
label="Tacos"
|
||||
@@ -28,7 +28,7 @@ describe('Select', () => {
|
||||
});
|
||||
|
||||
test('allows keyboard navigation', async () => {
|
||||
const handleChange = jest.fn();
|
||||
const handleChange = vi.fn();
|
||||
render(
|
||||
<Select
|
||||
label="Tacos"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { h } from 'preact';
|
||||
import Switch from '../Switch';
|
||||
import { fireEvent, render, screen } from 'testing-library';
|
||||
import { fireEvent, render, screen } from '@testing-library/preact';
|
||||
|
||||
describe('Switch', () => {
|
||||
test('renders a hidden checkbox', async () => {
|
||||
@@ -21,7 +21,7 @@ describe('Switch', () => {
|
||||
});
|
||||
|
||||
test('calls onChange callback when checked/unchecked', async () => {
|
||||
const handleChange = jest.fn();
|
||||
const handleChange = vi.fn();
|
||||
const { rerender } = render(<Switch id="check" onChange={handleChange} />);
|
||||
fireEvent.change(screen.queryByTestId('check-input'), { checked: true });
|
||||
expect(handleChange).toHaveBeenCalledWith('check', true);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { h } from 'preact';
|
||||
import TextField from '../TextField';
|
||||
import { render, screen, fireEvent } from 'testing-library';
|
||||
import { render, screen, fireEvent } from '@testing-library/preact';
|
||||
|
||||
describe('TextField', () => {
|
||||
test('can render a leading icon', async () => {
|
||||
@@ -21,7 +21,7 @@ describe('TextField', () => {
|
||||
});
|
||||
|
||||
test('onChange updates the value', async () => {
|
||||
const handleChangeText = jest.fn();
|
||||
const handleChangeText = vi.fn();
|
||||
render(<TextField label="Tacos" onChangeText={handleChangeText} />);
|
||||
|
||||
const input = screen.getByRole('textbox');
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { h, createRef } from 'preact';
|
||||
import Tooltip from '../Tooltip';
|
||||
import { render, screen } from 'testing-library';
|
||||
import { render, screen } from '@testing-library/preact';
|
||||
|
||||
describe('Tooltip', () => {
|
||||
test('renders in a relative position', async () => {
|
||||
jest
|
||||
vi
|
||||
.spyOn(window.HTMLElement.prototype, 'getBoundingClientRect')
|
||||
// relativeTo
|
||||
.mockReturnValueOnce({
|
||||
@@ -32,7 +32,7 @@ describe('Tooltip', () => {
|
||||
|
||||
test('if too far right, renders to the left', async () => {
|
||||
window.innerWidth = 1024;
|
||||
jest
|
||||
vi
|
||||
.spyOn(window.HTMLElement.prototype, 'getBoundingClientRect')
|
||||
// relativeTo
|
||||
.mockReturnValueOnce({
|
||||
@@ -59,7 +59,7 @@ describe('Tooltip', () => {
|
||||
});
|
||||
|
||||
test('if too far left, renders to the right', async () => {
|
||||
jest
|
||||
vi
|
||||
.spyOn(window.HTMLElement.prototype, 'getBoundingClientRect')
|
||||
// relativeTo
|
||||
.mockReturnValueOnce({
|
||||
@@ -87,7 +87,7 @@ describe('Tooltip', () => {
|
||||
|
||||
test('if too close to top, renders to the bottom', async () => {
|
||||
window.scrollY = 90;
|
||||
jest
|
||||
vi
|
||||
.spyOn(window.HTMLElement.prototype, 'getBoundingClientRect')
|
||||
// relativeTo
|
||||
.mockReturnValueOnce({
|
||||
|
||||
Reference in New Issue
Block a user