mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-06-07 17:52:26 +03:00
improve tests
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
import { describe, test, expect, vitest } from 'vitest';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { useState } from 'react';
|
||||
import { describe, test, afterEach, expect, vitest } from 'vitest';
|
||||
import { render, screen, cleanup } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { OverlayScrollbars } from 'overlayscrollbars';
|
||||
import { OverlayScrollbarsComponent } from '~/overlayscrollbars-react';
|
||||
import type { RefObject } from 'react';
|
||||
import type { OverlayScrollbarsComponentRef } from '~/overlayscrollbars-react';
|
||||
|
||||
describe('OverlayScrollbarsComponent', () => {
|
||||
afterEach(() => cleanup());
|
||||
|
||||
describe('correct rendering', () => {
|
||||
test('correct root element with instance', () => {
|
||||
const elementA = 'code';
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import { useRef } from 'react';
|
||||
import { describe, test, expect } from 'vitest';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { describe, test, afterEach, expect } from 'vitest';
|
||||
import { render, screen, cleanup } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { useOverlayScrollbars } from '~/overlayscrollbars-react';
|
||||
import type { OverlayScrollbars } from 'overlayscrollbars';
|
||||
|
||||
describe('useOverlayScrollbars', () => {
|
||||
afterEach(() => cleanup());
|
||||
|
||||
test('re-initialization', () => {
|
||||
const Test = () => {
|
||||
const instanceRef = useRef<OverlayScrollbars | null>(null);
|
||||
|
||||
Reference in New Issue
Block a user