storj/web/satellite/tests/unit/notifications/Notification.spec.ts
Bogdan Artemenko 8a79d184aa
[V3-965] Satellite account. Fixed Vue lint errors (#890)
* [V3-965] Satellite account. Fixed Vue lint errors
2018-12-18 16:43:23 +02:00

44 lines
1.0 KiB
TypeScript

// Copyright (C) 2018 Storj Labs, Inc.
// See LICENSE for copying information.
import { mount, shallowMount } from '@vue/test-utils';
import Notification from '@/components/notifications/Notification.vue';
import { NOTIFICATION_TYPES } from '@/utils/constants/notification';
describe('Notification.vue', () => {
it('renders correctly', () => {
const wrapper = shallowMount(Notification);
expect(wrapper).toMatchSnapshot();
});
it('renders correctly with props', () => {
const testMessage = 'testMessage';
const wrapper = mount(Notification, {
propsData: {
type: NOTIFICATION_TYPES.SUCCESS,
message: testMessage,
},
});
expect(wrapper).toMatchSnapshot();
expect(wrapper.find('.notification-wrap__text').text()).toMatch(testMessage);
wrapper.setProps({
type: NOTIFICATION_TYPES.ERROR,
message: testMessage,
});
expect(wrapper).toMatchSnapshot();
wrapper.setProps({
type: NOTIFICATION_TYPES.NOTIFICATION,
message: testMessage,
});
expect(wrapper).toMatchSnapshot();
});
});