Skip to content

Commit 6114a67

Browse files
committed
Added tests for the uncovered lines
1 parent fdadfe6 commit 6114a67

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/unit/specs/components/LicenseCode.spec.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('LicenseCode.vue', () => {
1515
localVue.use(Vuex)
1616
state = {
1717
attributionDetails: {
18-
creatorName: 'J Doe',
18+
creatorName: '',
1919
creatorProfileUrl: 'www.author.com',
2020
workTitle: 'My work',
2121
workUrl: 'www.author.com/pic.jpg'
@@ -54,13 +54,22 @@ describe('LicenseCode.vue', () => {
5454
})
5555

5656
// Tests for computed props and methods
57+
it('Check the creatorSpan function returns else text correctly', () => {
58+
expect(wrapper.vm.creatorSpan).toBe('')
59+
})
60+
it('Check if the byString function returns else text correctly', () => {
61+
expect(wrapper.vm.byString).toBe('')
62+
})
5763
it('Check if the byString function returns the correct text', () => {
64+
state.attributionDetails.creatorName = 'J Doe'
5865
expect(wrapper.vm.byString).toBe('license-use.richtext.by')
5966
})
6067
it('Check if the creatorSpan function returns the correct text', () => {
68+
state.attributionDetails.creatorName = 'J Doe'
6169
expect(wrapper.vm.creatorSpan).toBe('<span rel="cc:attributionName">J Doe</span>')
6270
})
6371
it('Check if the creatorName function returns the correct text', () => {
72+
state.attributionDetails.creatorName = 'J Doe'
6473
expect(wrapper.vm.creatorName).toBe('J Doe')
6574
})
6675
it('Check if the creatorProfileUrl function returns the correct text', () => {

0 commit comments

Comments
 (0)