diff --git a/src/components/LicenseCode.vue b/src/components/LicenseCode.vue index 4c77fbe2e..afddf3426 100644 --- a/src/components/LicenseCode.vue +++ b/src/components/LicenseCode.vue @@ -17,14 +17,14 @@ {{ $t('license-use.richtext.workTitle') }} {{ workTitle }} {{ workTitle }} @@ -100,7 +100,7 @@ export default { }, creatorSpan() { if (this.creatorName) { - return `${this.creatorName}` + return `${this.creatorName}` } else return '' }, creatorName() { diff --git a/src/utils/license-utilities.js b/src/utils/license-utilities.js index 5f601a181..197c2526e 100644 --- a/src/utils/license-utilities.js +++ b/src/utils/license-utilities.js @@ -154,7 +154,7 @@ function generateHTML(attributionDetails, shortLicenseName) { if (workUrl) { dataForHtmlGeneration.workTitle = `${workTitle}` } else { - dataForHtmlGeneration.workTitle = `${workTitle}` + dataForHtmlGeneration.workTitle = `${workTitle}` } } return dataForHtmlGeneration diff --git a/tests/unit/specs/components/LicenseCode.spec.js b/tests/unit/specs/components/LicenseCode.spec.js index d9c3186a0..d885a60d3 100644 --- a/tests/unit/specs/components/LicenseCode.spec.js +++ b/tests/unit/specs/components/LicenseCode.spec.js @@ -66,7 +66,7 @@ describe('LicenseCode.vue', () => { }) it('Check if the creatorSpan function returns the correct text', () => { state.attributionDetails.creatorName = 'J Doe' - expect(wrapper.vm.creatorSpan).toBe('J Doe') + expect(wrapper.vm.creatorSpan).toBe('J Doe') }) it('Check if the creatorName function returns the correct text', () => { state.attributionDetails.creatorName = 'J Doe' diff --git a/tests/unit/specs/utils/license-uilities.test.js b/tests/unit/specs/utils/license-uilities.test.js index abb2912ac..9e3629817 100644 --- a/tests/unit/specs/utils/license-uilities.test.js +++ b/tests/unit/specs/utils/license-uilities.test.js @@ -373,7 +373,7 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus() // test('creator name', () => { // const attr = { creatorName: 'John' } // expect(generateHTML(attr, license)).toEqual({ -// creator: 'John', +// creator: 'John', // htmlString: '
',
// licenseIconsLink: '',
// workTitle: ''
@@ -382,7 +382,7 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// test('creator name + url', () => {
// const attr = { creatorName: 'John', creatorProfileUrl: 'j@doe.com' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'John',
+// creator: 'John',
// htmlString: '
',
// licenseIconsLink: '',
// workTitle: ''
@@ -394,7 +394,7 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// creator: '',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('work title + url', () => {
@@ -403,43 +403,43 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// creator: '',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name; work title', () => {
// const attr = { workTitle: 'Foo', creatorName: 'Jane' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name + url; work title', () => {
// const attr = { creatorName: 'Jane', creatorProfileUrl: 'j@doe.com', workTitle: 'Foo' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name; work title + url', () => {
// const attr = { creatorName: 'Jane', workTitle: 'Foo', workUrl: 'www.foo.bar' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name + url; work title + url', () => {
// const attr = { creatorName: 'Jane', creatorProfileUrl: 'j@doe.com', workTitle: 'Foo', workUrl: 'www.foo.bar' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// })
@@ -458,7 +458,7 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// test('creator name', () => {
// const attr = { creatorName: 'John' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'John',
+// creator: 'John',
// htmlString: '
',
// licenseIconsLink: '',
// workTitle: ''
@@ -467,7 +467,7 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// test('creator name + url', () => {
// const attr = { creatorName: 'John', creatorProfileUrl: 'j@doe.com' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'John',
+// creator: 'John',
// htmlString: '
',
// licenseIconsLink: '',
// workTitle: ''
@@ -479,7 +479,7 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// creator: '',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('work title + url', () => {
@@ -488,43 +488,43 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// creator: '',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name; work title', () => {
// const attr = { workTitle: 'Foo', creatorName: 'Jane' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name + url; work title', () => {
// const attr = { creatorName: 'Jane', creatorProfileUrl: 'j@doe.com', workTitle: 'Foo' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name; work title + url', () => {
// const attr = { creatorName: 'Jane', workTitle: 'Foo', workUrl: 'www.foo.bar' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name + url; work title + url', () => {
// const attr = { creatorName: 'Jane', creatorProfileUrl: 'j@doe.com', workTitle: 'Foo', workUrl: 'www.foo.bar' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// })
@@ -543,7 +543,7 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// test('creator name', () => {
// const attr = { creatorName: 'John' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'John',
+// creator: 'John',
// htmlString: '
',
// licenseIconsLink: '',
// workTitle: ''
@@ -552,7 +552,7 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// test('creator name + url', () => {
// const attr = { creatorName: 'John', creatorProfileUrl: 'j@doe.com' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'John',
+// creator: 'John',
// htmlString: '
',
// licenseIconsLink: '',
// workTitle: ''
@@ -564,7 +564,7 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// creator: '',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('work title + url', () => {
@@ -573,43 +573,43 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// creator: '',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name; work title', () => {
// const attr = { workTitle: 'Foo', creatorName: 'Jane' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name + url; work title', () => {
// const attr = { creatorName: 'Jane', creatorProfileUrl: 'j@doe.com', workTitle: 'Foo' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name; work title + url', () => {
// const attr = { creatorName: 'Jane', workTitle: 'Foo', workUrl: 'www.foo.bar' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name + url; work title + url', () => {
// const attr = { creatorName: 'Jane', creatorProfileUrl: 'j@doe.com', workTitle: 'Foo', workUrl: 'www.foo.bar' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// })
@@ -628,7 +628,7 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// test('creator name', () => {
// const attr = { creatorName: 'John' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'John',
+// creator: 'John',
// htmlString: '
',
// licenseIconsLink: '',
// workTitle: ''
@@ -637,7 +637,7 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// test('creator name + url', () => {
// const attr = { creatorName: 'John', creatorProfileUrl: 'j@doe.com' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'John',
+// creator: 'John',
// htmlString: '
',
// licenseIconsLink: '',
// workTitle: ''
@@ -649,7 +649,7 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// creator: '',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('work title + url', () => {
@@ -658,43 +658,43 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// creator: '',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name; work title', () => {
// const attr = { workTitle: 'Foo', creatorName: 'Jane' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name + url; work title', () => {
// const attr = { creatorName: 'Jane', creatorProfileUrl: 'j@doe.com', workTitle: 'Foo' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name; work title + url', () => {
// const attr = { creatorName: 'Jane', workTitle: 'Foo', workUrl: 'www.foo.bar' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name + url; work title + url', () => {
// const attr = { creatorName: 'Jane', creatorProfileUrl: 'j@doe.com', workTitle: 'Foo', workUrl: 'www.foo.bar' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// })
@@ -713,7 +713,7 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// test('creator name', () => {
// const attr = { creatorName: 'John' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'John',
+// creator: 'John',
// htmlString: '
',
// licenseIconsLink: '',
// workTitle: ''
@@ -722,7 +722,7 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// test('creator name + url', () => {
// const attr = { creatorName: 'John', creatorProfileUrl: 'j@doe.com' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'John',
+// creator: 'John',
// htmlString: '
',
// licenseIconsLink: '',
// workTitle: ''
@@ -734,7 +734,7 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// creator: '',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('work title + url', () => {
@@ -743,43 +743,43 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// creator: '',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name; work title', () => {
// const attr = { workTitle: 'Foo', creatorName: 'Jane' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name + url; work title', () => {
// const attr = { creatorName: 'Jane', creatorProfileUrl: 'j@doe.com', workTitle: 'Foo' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name; work title + url', () => {
// const attr = { creatorName: 'Jane', workTitle: 'Foo', workUrl: 'www.foo.bar' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name + url; work title + url', () => {
// const attr = { creatorName: 'Jane', creatorProfileUrl: 'j@doe.com', workTitle: 'Foo', workUrl: 'www.foo.bar' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// })
@@ -798,7 +798,7 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// test('creator name', () => {
// const attr = { creatorName: 'John' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'John',
+// creator: 'John',
// htmlString: '
',
// licenseIconsLink: '',
// workTitle: ''
@@ -807,7 +807,7 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// test('creator name + url', () => {
// const attr = { creatorName: 'John', creatorProfileUrl: 'j@doe.com' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'John',
+// creator: 'John',
// htmlString: '
',
// licenseIconsLink: '',
// workTitle: ''
@@ -819,7 +819,7 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// creator: '',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('work title + url', () => {
@@ -828,43 +828,43 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// creator: '',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name; work title', () => {
// const attr = { workTitle: 'Foo', creatorName: 'Jane' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name + url; work title', () => {
// const attr = { creatorName: 'Jane', creatorProfileUrl: 'j@doe.com', workTitle: 'Foo' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name; work title + url', () => {
// const attr = { creatorName: 'Jane', workTitle: 'Foo', workUrl: 'www.foo.bar' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name + url; work title + url', () => {
// const attr = { creatorName: 'Jane', creatorProfileUrl: 'j@doe.com', workTitle: 'Foo', workUrl: 'www.foo.bar' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// })
@@ -883,7 +883,7 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// test('creator name', () => {
// const attr = { creatorName: 'John' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'John',
+// creator: 'John',
// htmlString: '
',
// licenseIconsLink: '',
// workTitle: ''
@@ -892,7 +892,7 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// test('creator name + url', () => {
// const attr = { creatorName: 'John', creatorProfileUrl: 'j@doe.com' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'John',
+// creator: 'John',
// htmlString: '
',
// licenseIconsLink: '',
// workTitle: ''
@@ -904,7 +904,7 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// creator: '',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('work title + url', () => {
@@ -913,43 +913,43 @@ describe('updateVisibleEnabledStatus', function testUpdateVisibleEnabledStatus()
// creator: '',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name; work title', () => {
// const attr = { workTitle: 'Foo', creatorName: 'Jane' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name + url; work title', () => {
// const attr = { creatorName: 'Jane', creatorProfileUrl: 'j@doe.com', workTitle: 'Foo' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name; work title + url', () => {
// const attr = { creatorName: 'Jane', workTitle: 'Foo', workUrl: 'www.foo.bar' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// test('creator name + url; work title + url', () => {
// const attr = { creatorName: 'Jane', creatorProfileUrl: 'j@doe.com', workTitle: 'Foo', workUrl: 'www.foo.bar' }
// expect(generateHTML(attr, license)).toEqual({
-// creator: 'Jane',
+// creator: 'Jane',
// htmlString: '
',
// licenseIconsLink: '',
-// workTitle: 'Foo'
+// workTitle: 'Foo'
// })
// })
// })