2022-11-26 08:34:23 +11:00
|
|
|
import React from 'react'
|
|
|
|
import { render, screen } from '@testing-library/react'
|
|
|
|
import App from './App'
|
2022-11-12 13:11:54 +11:00
|
|
|
|
2022-11-26 08:34:23 +11:00
|
|
|
let listener: ((rect: any) => void) | undefined = undefined
|
|
|
|
;(global as any).ResizeObserver = class ResizeObserver {
|
2022-11-25 11:02:00 +11:00
|
|
|
constructor(ls: ((rect: any) => void) | undefined) {
|
2022-11-26 08:34:23 +11:00
|
|
|
listener = ls
|
2022-11-25 11:02:00 +11:00
|
|
|
}
|
|
|
|
observe() {}
|
|
|
|
unobserve() {}
|
|
|
|
disconnect() {}
|
2022-11-26 08:34:23 +11:00
|
|
|
}
|
2022-11-25 11:02:00 +11:00
|
|
|
|
2022-11-26 08:34:23 +11:00
|
|
|
test('renders learn react link', () => {
|
|
|
|
render(<App />)
|
2023-02-03 11:09:09 +11:00
|
|
|
const linkElement = screen.getByText(/Variables/i)
|
2022-11-26 08:34:23 +11:00
|
|
|
expect(linkElement).toBeInTheDocument()
|
|
|
|
})
|