make boilder plate react test happy with new dependencies

This commit is contained in:
Kurt Hutten IrevDev
2022-11-25 11:02:00 +11:00
parent b4f9e70752
commit e7e0f2a4fd
4 changed files with 19 additions and 7 deletions

View File

@ -1,9 +1,19 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import App from './App';
import React from "react";
import { render, screen } from "@testing-library/react";
import App from "./App";
test('renders learn react link', () => {
let listener: ((rect: any) => void) | undefined = undefined;
(global as any).ResizeObserver = class ResizeObserver {
constructor(ls: ((rect: any) => void) | undefined) {
listener = ls;
}
observe() {}
unobserve() {}
disconnect() {}
};
test("renders learn react link", () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
const linkElement = screen.getByText(/viewer/i);
expect(linkElement).toBeInTheDocument();
});