diff --git a/webapp/src/components/AssetCard/AssetCard.spec.tsx b/webapp/src/components/AssetCard/AssetCard.spec.tsx index 66eba391f8..e779118aad 100644 --- a/webapp/src/components/AssetCard/AssetCard.spec.tsx +++ b/webapp/src/components/AssetCard/AssetCard.spec.tsx @@ -93,6 +93,7 @@ describe('AssetCard', () => { expect(screen.getByTestId('asset-card-content')).toBeInTheDocument() }) }) + describe('when its not interesected', () => { it('should not render the Asset Card content', () => { renderAssetCard({ @@ -107,20 +108,25 @@ describe('AssetCard', () => { asset = { ...asset, itemId: 'itemId' } as Asset }) - describe('when the asset is an item', () => { - beforeEach(() => { - asset = { ...asset, itemId: 'itemId' } as Asset + it('should render the favorites counter', () => { + renderAssetCard({ + asset }) + mockAllIsIntersecting(true) + expect(screen.getByTestId(FAVORITES_COUNTER_TEST_ID)).toBeInTheDocument() + }) + }) - it('should render the favorites counter', () => { - renderAssetCard({ - asset - }) - mockAllIsIntersecting(true) - expect( - screen.getByTestId(FAVORITES_COUNTER_TEST_ID) - ).toBeInTheDocument() + describe('when the asset is an nft', () => { + beforeEach(() => { + asset = { ...asset, tokenId: 'tokenId' } as Asset + }) + + it('should not render the favorites counter', () => { + const { queryByTestId } = renderAssetCard({ + asset }) + expect(queryByTestId(FAVORITES_COUNTER_TEST_ID)).toBeNull() }) }) }) diff --git a/webapp/src/components/AssetCard/EmoteTags/EmoteTags.tsx b/webapp/src/components/AssetCard/EmoteTags/EmoteTags.tsx index 77986d31fc..a967ee14bb 100644 --- a/webapp/src/components/AssetCard/EmoteTags/EmoteTags.tsx +++ b/webapp/src/components/AssetCard/EmoteTags/EmoteTags.tsx @@ -1,5 +1,8 @@ -import { NFTCategory } from '@dcl/schemas' import classNames from 'classnames' +import { NFTCategory } from '@dcl/schemas' +import { Popup } from 'decentraland-ui' +import { T } from 'decentraland-dapps/dist/modules/translation/utils' +import { isNFT } from '../../../modules/asset/utils' import { AssetType } from '../../../modules/asset/types' import RarityBadge from '../../RarityBadge' import { Props } from './EmoteTags.types' @@ -7,17 +10,35 @@ import styles from './EmoteTags.module.css' const EmoteTags = (props: Props) => { const { asset } = props - const { rarity } = asset.data.emote! + const { rarity, loop } = asset.data.emote || {} return (