1- import { config , createLocalVue , mount } from '@vue/test-utils'
2- import SelectedLicenseDropdown from '@/components/SelectedLicenseDropdown'
3- import Buefy from 'buefy'
4- import LicenseUtilities from '@/utils/license-utilities'
51import Vue from 'vue'
62import VueI18n from 'vue-i18n'
3+ import Buefy from 'buefy'
4+ import { config , createLocalVue , mount } from '@vue/test-utils'
5+ import LicenseUtilities from '@/utils/license-utilities'
6+ import SelectedLicenseDropdown from '@/components/SelectedLicenseDropdown'
77
88const value = {
99 shortName : 'CC BY 4.0' ,
@@ -29,9 +29,7 @@ describe('LicenseDropdown.vue', () => {
2929 fallbackLocale : 'en' ,
3030 messages : messages
3131 } )
32-
3332 config . mocks . i18n = i18n
34-
3533 config . mocks . $t = ( key ) => {
3634 return i18n . messages [ key ]
3735 }
@@ -43,14 +41,12 @@ describe('LicenseDropdown.vue', () => {
4341 } )
4442 } )
4543 describe ( 'correctly displays initial information and options when mounted' , ( ) => {
46-
4744 it ( 'initializes with base license names' , ( ) => {
4845 expect ( wrapper . vm . $props . value . shortName ) . toEqual ( 'CC BY 4.0' )
4946 expect ( wrapper . vm . $props . value . fullName ) . toEqual ( 'Attribution 4.0 International' )
5047 expect ( wrapper . html ( ) ) . toContain ( 'CC BY 4.0' )
5148 expect ( wrapper . findAll ( 'option' ) ) . toHaveLength ( 7 )
5249 } )
53-
5450 it ( 'calculate fullLicenseName correctly' , ( ) => {
5551 wrapper . vm . value . shortName = 'CC BY-ND 4.0'
5652 expect ( wrapper . vm . fullLicenseName ( 'CC BY-ND 4.0' ) ) . toEqual ( 'Attribution-NoDerivatives 4.0 International' )
0 commit comments