File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
tests/unit/specs/components Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff 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' , ( ) => {
You can’t perform that action at this time.
0 commit comments