I have a UI library that we import into our app. In the UI library is a custom directive, toggle, that we use for opening and closing a modal. When I run unit tests, I get this error:
[Vue warn]: Failed to resolve directive: toggle
(found in <Identity>)
In my Identity component, I'm using a component from the UI library, checkbox, that incorporates this directive:
<checkbox
:value="rememberMe"
:label="$t('identity.rememberMeHeading')"
name="rememberMe"
data-test="remember-me"
@input="toggleRememberMe()">
<span slot="subtext"> {{ $t('identity.rememberMeSubheading') }}
<a v-toggle:a-modal="'learn-more-modal'"
@click.prevent="() => {}">{{ $t('identity.learnMore') }}</a>
</span>
</checkbox>
How do I fix this error in my Identity.spec.js? After my imports, I have:
const localVue = createLocalVue()
localVue.use(Vuex)
localVue.use('toggle')