From ad7798dd4d7a1e7660b028a1f5612a2c177a4d08 Mon Sep 17 00:00:00 2001 From: yougotwill Date: Thu, 25 Jul 2024 15:03:46 +1000 Subject: [PATCH] fix: remove uneeded cleanup() calls in component unit tests --- ts/test/components/AvatarPlaceHolder_test.tsx | 5 ++--- ts/test/components/SessionInput_test.tsx | 2 -- ts/test/session/unit/updater/updater_test.ts | 3 ++- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ts/test/components/AvatarPlaceHolder_test.tsx b/ts/test/components/AvatarPlaceHolder_test.tsx index e4e39702f..ff36ef6ff 100644 --- a/ts/test/components/AvatarPlaceHolder_test.tsx +++ b/ts/test/components/AvatarPlaceHolder_test.tsx @@ -1,5 +1,4 @@ /* eslint-disable import/no-extraneous-dependencies */ -import { cleanup } from '@testing-library/react'; import { expect } from 'chai'; import Sinon from 'sinon'; import { AvatarSize } from '../../components/avatar/Avatar'; @@ -19,7 +18,6 @@ describe('AvatarPlaceHolder', () => { afterEach(() => { Sinon.restore(); - cleanup(); }); it('should render an svg', async () => { @@ -55,11 +53,12 @@ describe('AvatarPlaceHolder', () => { expect(areResultsEqual(result, result2, true)).to.equal(true); result.unmount(); + result2.unmount(); }); it('should render the background using a color from our theme', async () => { const testPubkey = TestUtils.generateFakePubKeyStr(); const result = renderComponent( - // NOTE we test the pubkey to color generation and ordering with appium. Since we can't access the value of a css variable in the test + // NOTE we need to test the pubkey to color generation and ordering with appium. Since we can't access the value of a css variable in with the current unit test setup { afterEach(() => { Sinon.restore(); - cleanup(); }); it('should render an input', async () => { diff --git a/ts/test/session/unit/updater/updater_test.ts b/ts/test/session/unit/updater/updater_test.ts index 232c2106b..887faec20 100644 --- a/ts/test/session/unit/updater/updater_test.ts +++ b/ts/test/session/unit/updater/updater_test.ts @@ -1,6 +1,7 @@ +import path from 'path'; + import { readFileSync } from 'fs-extra'; import { isEmpty } from 'lodash'; -import path from 'path'; describe('Updater', () => { it.skip('isUpdateAvailable', () => {});