1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00
metamask-extension/ui/helpers/utils/nfts.test.js
Nidhi Kumari 3be1fc6d0c
converted collectibles files to nfts (#17658)
* converted collectibles files to nfts

* updated relative import for scss

* updated scss for pages
2023-02-08 20:04:56 +05:30

32 lines
859 B
JavaScript

import { getCollectibleImageAlt } from './nfts';
describe('Collectibles Utils', () => {
describe('getCollectibleImageAlt', () => {
it('returns the description attribute when it is available', () => {
expect(
getCollectibleImageAlt({
name: 'Cool NFT',
tokenId: '555',
description: 'This is a really cool NFT',
}),
).toBe('This is a really cool NFT');
});
it('returns the formatted name and tokenId attributes when a description is not present', () => {
expect(
getCollectibleImageAlt({
name: 'Cool NFT',
tokenId: '555',
description: null,
}),
).toBe('Cool NFT 555');
expect(
getCollectibleImageAlt({
name: 'Cool NFT',
tokenId: '555',
}),
).toBe('Cool NFT 555');
});
});
});