Skip to content

Commit 0670347

Browse files
authored
Merge pull request #33 from contentstack/chore/improving-coverage
Chore/improving coverage
2 parents da495e8 + e4b172d commit 0670347

File tree

5 files changed

+7657
-8013
lines changed

5 files changed

+7657
-8013
lines changed

__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)