Skip to content

Commit e3c927b

Browse files
committed
test: ✅ adds test case and corrects linting
1 parent b4769b3 commit e3c927b

5 files changed

Lines changed: 11316 additions & 8449 deletions

File tree

__test__/default-options.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { entryContentBlank, entryContentURL, entryContentTitle, entryContentTitl
44
import { RenderItem } from '../src/options/index';
55
import { assetContentBlank,
66
assetContentUrl,
7+
assetContentWithoutTitleAndUID,
78
assetContentonlyFileName,
89
assetContentonlyFileNameAndURL,
910
assetContentonlyTitle,
@@ -93,6 +94,11 @@ describe('Default Option test', () => {
9394
done()
9495
})
9596

97+
it('Default options Asset with uid, url and filename test', done => {
98+
expect(assetDownloadFunction(assetContentWithoutTitleAndUID, embedAttributes)).toEqual(`<a href="${assetContentWithoutTitleAndUID.url}">${assetContentWithoutTitleAndUID.system.content_type_uid}</a>`)
99+
done()
100+
})
101+
96102
it('Default options Link text test', done => {
97103
expect(entryLinkFunction(entryContentURL, embedAttributesText)).toEqual(`<a href="${entryContentURL.url}">${linkText}</a>`)
98104
expect(entryLinkFunction(entryContentTitle, embedAttributesText)).toEqual(`<a href="undefined">${linkText}</a>`)

__test__/mock/asset-mock.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,13 @@ export const assetContentonlyTitleAndUrl = {
3333
title: "title",
3434
url: "url",
3535
_content_type_uid: 'sys_assets'
36+
}
37+
38+
export const assetContentWithoutTitleAndUID = {
39+
url: "url",
40+
_content_type_uid: 'sys_assets',
41+
system: {
42+
uid: 'sys_uid',
43+
content_type_uid: 'ct_uid'
44+
}
3645
}

0 commit comments

Comments
 (0)