From a526cff13a8f5368bde792efa2b5754c7cd689bc Mon Sep 17 00:00:00 2001 From: Gabriel Lee Date: Thu, 12 Sep 2024 13:29:18 +0100 Subject: [PATCH] fix: tests --- .../SpaceListItem/SpaceListItem.unit.test.tsx | 13 -------- .../SpaceListItem.unit.test.tsx.snap | 33 ++++++++++--------- .../SpaceRowContent.unit.test.tsx | 13 ++++++++ .../SpaceRowContent.unit.test.tsx.snap | 12 +++---- 4 files changed, 36 insertions(+), 35 deletions(-) diff --git a/src/components/SpaceListItem/SpaceListItem.unit.test.tsx b/src/components/SpaceListItem/SpaceListItem.unit.test.tsx index dca3a39887..0ddc730151 100644 --- a/src/components/SpaceListItem/SpaceListItem.unit.test.tsx +++ b/src/components/SpaceListItem/SpaceListItem.unit.test.tsx @@ -8,7 +8,6 @@ import Icon from '../Icon'; import { mountAndWait } from '../../../test/utils'; import ListItemBase from '../ListItemBase'; import * as ListContext from '../List/List.utils'; -import { STYLE } from './SpaceListItem.constants'; import DividerDot from '../DividerDot'; describe('', () => { @@ -451,18 +450,6 @@ describe('', () => { expect(container.filter("[data-test='compact-mode-divider-dot']").length).toEqual(0); }); - it('should have provided isNewActivity class when isNewActivity is provided', async () => { - expect.assertions(1); - - const isNewActivity = true; - - const element = (await mountAndWait()).find( - ListItemBase - ); - - expect(element.hasClass(STYLE.isNewActivity)).toBe(true); - }); - it('should have provided unread when isUnread is provided', async () => { expect.assertions(1); diff --git a/src/components/SpaceListItem/SpaceListItem.unit.test.tsx.snap b/src/components/SpaceListItem/SpaceListItem.unit.test.tsx.snap index db84622102..b26b4dc991 100644 --- a/src/components/SpaceListItem/SpaceListItem.unit.test.tsx.snap +++ b/src/components/SpaceListItem/SpaceListItem.unit.test.tsx.snap @@ -946,7 +946,7 @@ exports[` snapshot should match snapshot with isEnterRoom 1`] = isEnterRoom={true} > snapshot should match snapshot with isEnterRoom 1`] = isInset={false} >
  • snapshot should match snapshot with isEnterRoom 1`] = />
    snapshot should match snapshot with isMention 1`] = ` isMention={true} > snapshot should match snapshot with isMention 1`] = ` isInset={false} >
  • snapshot should match snapshot with isMention 1`] = ` />
    snapshot should match snapshot with isNewActivity 1`] isNewActivity={true} > snapshot should match snapshot with isNewActivity 1`] isInset={false} >
  • snapshot should match snapshot with isNewActivity 1`] snapshot should match snapshot with isNewActivity 1`] />
    snapshot should match snapshot with isUnread 1`] = ` isUnread={true} > snapshot should match snapshot with isUnread 1`] = ` isInset={false} >
  • snapshot should match snapshot with isUnread 1`] = ` />
    ', () => { describe('snapshot', () => { @@ -365,6 +366,18 @@ describe('', () => { expect(container.filter("[data-test='compact-mode-divider-dot']").length).toEqual(0); }); + it('should have provided isNewActivity class when isNewActivity is provided', async () => { + expect.assertions(1); + + const isNewActivity = true; + + const element = (await mountAndWait()) + .find(ListItemBaseSection) + .find({ position: 'middle' }); + + expect(element.hasClass('md-space-row-content-is-new-activity')).toBe(true); + }); + it('should have provided unread when isUnread is provided', async () => { expect.assertions(1); diff --git a/src/components/SpaceRowContent/SpaceRowContent.unit.test.tsx.snap b/src/components/SpaceRowContent/SpaceRowContent.unit.test.tsx.snap index 26d96e4b37..da6ed9a67d 100644 --- a/src/components/SpaceRowContent/SpaceRowContent.unit.test.tsx.snap +++ b/src/components/SpaceRowContent/SpaceRowContent.unit.test.tsx.snap @@ -423,11 +423,11 @@ exports[` snapshot should match snapshot with isEnterRoom 1`] />
    snapshot should match snapshot with isMention 1`] = />
    snapshot should match snapshot with isUnread 1`] = />