Skip to content

Commit

Permalink
test: increase coverage for components in isolation (#475)
Browse files Browse the repository at this point in the history
closes #468
  • Loading branch information
devCrossNet committed Oct 12, 2019
1 parent 47f74a4 commit 6d662cf
Show file tree
Hide file tree
Showing 23 changed files with 21 additions and 27 deletions.
6 changes: 0 additions & 6 deletions src/app/app/App/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
<vue-navigation-progress :is-navigating="isNavigating" />

<vue-nav-bar>
<router-link slot="middle" to="/">
<vue-icon-vuesion :class="$style.logo" />
</router-link>

<vue-button slot="right" v-if="isAuthenticated === false" color="primary" @click="showLoginModal = true">
Login
</vue-button>
Expand Down Expand Up @@ -138,12 +134,10 @@ import VueButton from '@components/VueButton/VueButton.vue';
import VueModal from '@components/VueModal/VueModal.vue';
import LoginForm from '@shared/modules/auth/LoginForm/LoginForm.vue';
import { addNotification } from '@components/VueNotificationStack/utils';
import VueIconVuesion from '@components/icons/VueIconVuesion/VueIconVuesion.vue';
export default {
name: 'App',
components: {
VueIconVuesion,
LoginForm,
VueModal,
VueButton,
Expand Down
9 changes: 1 addition & 8 deletions src/app/app/Error/Error.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<template>
<div :class="$style.error">
<vue-icon-vuesion :class="$style.logo" />
<vue-headline level="1">Error</vue-headline>
<vue-headline level="3">Try again later!</vue-headline>
</div>
</template>

<script lang="ts">
import VueHeadline from '@components/VueHeadline/VueHeadline.vue';
import VueIconVuesion from '@components/icons/VueIconVuesion/VueIconVuesion.vue';
export default {
metaInfo: {
Expand All @@ -21,7 +19,7 @@ export default {
],
},
name: 'Error',
components: { VueIconVuesion, VueHeadline },
components: { VueHeadline },
props: {},
data(): any {
return {};
Expand All @@ -42,9 +40,4 @@ export default {
margin: auto;
margin-top: 25%;
}
.logo {
width: $space-84;
height: $space-84;
}
</style>
9 changes: 1 addition & 8 deletions src/app/app/NotFound/NotFound.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<template>
<div :class="$style.notFound">
<vue-icon-vuesion :class="$style.logo" />
<vue-headline level="1">404</vue-headline>
<vue-headline level="3">Page not found!</vue-headline>
</div>
</template>

<script lang="ts">
import VueHeadline from '@components/VueHeadline/VueHeadline.vue';
import VueIconVuesion from '@components/icons/VueIconVuesion/VueIconVuesion.vue';
export default {
metaInfo: {
Expand All @@ -21,7 +19,7 @@ export default {
],
},
name: 'NotFound',
components: { VueIconVuesion, VueHeadline },
components: { VueHeadline },
props: {},
data(): any {
return {};
Expand All @@ -42,9 +40,4 @@ export default {
margin: auto;
margin-top: 25%;
}
.logo {
width: $space-84;
height: $space-84;
}
</style>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createLocalVue, mount } from '@vue/test-utils';
import FormExample from './FormExample.vue';
import { i18n } from '../../shared/plugins/i18n/i18n';
import { i18n } from '@shared/plugins/i18n/i18n';

const localVue = createLocalVue();

Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/app/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import VueRouter, { Route, RouteRecord } from 'vue-router';
import Meta from 'vue-meta';
import { AppRoutes } from './app/routes';
import { HomeRoutes } from './home/routes';
import { CounterRoutes } from './counter/routes';
import { FormRoutes } from './form/routes';
import { DashboardRoutes } from './dashboard/routes';
import { CounterRoutes } from './examples/counter/routes';
import { FormRoutes } from './examples/form/routes';
import { DashboardRoutes } from './examples/dashboard/routes';
import { store } from '@/app/store';

Vue.use(VueRouter);
Expand Down
14 changes: 14 additions & 0 deletions src/app/shared/components/VueSelect/VueSelect.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,18 @@ describe('VueSelect.vue', () => {

expect(wrapper.findAll(`.error`)).toHaveLength(1);
});

it('should render with value', () => {
const wrapper = mount<any>(VueSelect, {
localVue,
propsData: {
options,
value: 'bar',
name: 'name',
id: 'id',
},
});

expect(wrapper.findAll('.hasValue')).toHaveLength(1);
});
});
2 changes: 1 addition & 1 deletion src/app/state.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AppDefaultState, IAppState } from './app/state';
import { AuthDefaultState, IAuthState } from './shared/modules/auth/state';
import { ICounterState } from './counter/state';
import { ICounterState } from './examples/counter/state';

export interface IState {
[key: string]: any;
Expand Down

0 comments on commit 6d662cf

Please sign in to comment.