web/satellite: npm packages updated

Change-Id: I87c1507423817283047d70d0d741307e03905556
This commit is contained in:
VitaliiShpital 2020-01-08 17:58:28 +02:00 committed by Egon Elbre
parent 172918596b
commit 6bf40f3e59
15 changed files with 4177 additions and 4034 deletions

File diff suppressed because it is too large Load Diff

View File

@ -10,54 +10,50 @@
"dev": "vue-cli-service build --mode development"
},
"dependencies": {
"apollo-cache-inmemory": "1.6.3",
"apollo-client": "2.6.4",
"apollo-link": "1.2.12",
"apollo-link-context": "1.0.18",
"apollo-link-http": "1.5.15",
"graphql": "14.5.4",
"apollo-cache-inmemory": "1.6.5",
"apollo-client": "2.6.8",
"apollo-link": "1.2.13",
"apollo-link-context": "1.0.19",
"apollo-link-http": "1.5.16",
"graphql": "14.5.8",
"graphql-tag": "2.10.1",
"load-script": "^1.0.0",
"moment": "2.24.0",
"stripe": "7.8.0",
"vue": "2.6.10",
"load-script": "1.0.0",
"stripe": "7.14.0",
"vue": "2.6.11",
"vue-clipboards": "1.3.0",
"vue-property-decorator": "8.2.2",
"vue-router": "3.1.2",
"vuex": "3.1.1"
"vue-property-decorator": "8.3.0",
"vue-router": "3.1.3",
"vuex": "3.1.2"
},
"devDependencies": {
"@babel/core": "7.5.0",
"@babel/plugin-proposal-object-rest-spread": "7.5.0",
"@types/jest": "24.0.18",
"@types/sinon": "7.0.13",
"@types/stripe": "6.31.23",
"@vue/cli-plugin-babel": "3.11.0",
"@vue/cli-plugin-typescript": "3.11.0",
"@vue/cli-plugin-unit-jest": "3.11.0",
"@vue/cli-service": "3.11.0",
"@babel/core": "7.7.7",
"@babel/plugin-proposal-object-rest-spread": "7.7.7",
"@vue/cli-plugin-babel": "4.1.1",
"@vue/cli-plugin-typescript": "4.1.1",
"@vue/cli-plugin-unit-jest": "4.1.1",
"@vue/cli-service": "4.1.1",
"@types/segment-analytics": "0.0.32",
"@vue/test-utils": "1.0.0-beta.29",
"@vue/test-utils": "1.0.0-beta.30",
"babel-core": "7.0.0-bridge.0",
"compression-webpack-plugin": "3.0.0",
"jest-fetch-mock": "2.1.2",
"node-sass": "4.12.0",
"sass-loader": "7.1.0",
"sinon": "7.4.1",
"stylelint": "11.1.1",
"compression-webpack-plugin": "3.0.1",
"jest-fetch-mock": "3.0.0",
"node-sass": "4.13.0",
"sass-loader": "8.0.0",
"sinon": "7.5.0",
"stylelint": "12.0.1",
"stylelint-config-standard": "19.0.0",
"stylelint-scss": "3.12.0",
"stylelint-webpack-plugin": "1.0.2",
"ts-jest": "24.0.2",
"tslint": "5.19.0",
"tslint-consistent-codestyle": "1.15.1",
"stylelint-scss": "3.13.0",
"stylelint-webpack-plugin": "1.1.2",
"ts-jest": "24.2.0",
"tslint": "5.20.1",
"tslint-consistent-codestyle": "1.16.0",
"tslint-loader": "3.5.4",
"typescript": "3.5.3",
"vue-svg-loader": "0.12.0",
"vue-template-compiler": "2.6.10",
"typescript": "3.7.4",
"vue-svg-loader": "0.15.0",
"vue-template-compiler": "2.6.11",
"vue-tslint": "0.3.2",
"vue-tslint-loader": "3.5.6",
"webpack": "4.39.3"
"webpack": "4.41.5"
},
"postcss": {
"plugins": {

View File

@ -10,6 +10,7 @@ import { makeNotificationsModule } from '@/store/modules/notifications';
import { makeProjectsModule } from '@/store/modules/projects';
import { ApiKey, ApiKeysPage } from '@/types/apiKeys';
import { Project } from '@/types/projects';
import { NotificatorPlugin } from '@/utils/plugins/notificator';
import { SegmentioPlugin } from '@/utils/plugins/segment';
import { createLocalVue, shallowMount } from '@vue/test-utils';
@ -18,8 +19,10 @@ import { ProjectsApiMock } from '../mock/api/projects';
const localVue = createLocalVue();
const segmentioPlugin = new SegmentioPlugin();
const notificationPlugin = new NotificatorPlugin();
localVue.use(Vuex);
localVue.use(segmentioPlugin);
localVue.use(notificationPlugin);
const apiKeysApi = new ApiKeysMock();
const apiKeysModule = makeApiKeysModule(apiKeysApi);
@ -63,7 +66,7 @@ describe('ApiKeysArea', () => {
expect(wrapper.vm.apiKeyList).toEqual([apiKey]);
});
it('action on toggleSelection works correctly', () => {
it('action on toggleSelection works correctly', async () => {
store.commit(SET_PAGE, testApiKeysPage);
const wrapper = shallowMount(ApiKeysArea, {
@ -71,40 +74,40 @@ describe('ApiKeysArea', () => {
localVue,
});
wrapper.vm.toggleSelection(apiKey);
await wrapper.vm.toggleSelection(apiKey);
expect(store.getters.selectedApiKeys.length).toBe(1);
});
it('action on onClearSelection works correctly', () => {
it('action on onClearSelection works correctly', async () => {
const wrapper = shallowMount(ApiKeysArea, {
store,
localVue,
});
wrapper.vm.onClearSelection();
await wrapper.vm.onClearSelection();
expect(wrapper.vm.$data.isDeleteClicked).toBe(false);
});
it('function onCreateApiKeyClick works correctly', () => {
it('function onCreateApiKeyClick works correctly', async () => {
const wrapper = shallowMount(ApiKeysArea, {
store,
localVue,
});
wrapper.vm.onCreateApiKeyClick();
await wrapper.vm.onCreateApiKeyClick();
expect(wrapper.vm.$data.isNewApiKeyPopupShown).toBe(true);
});
it('function onFirstDeleteClick works correctly', () => {
it('function onFirstDeleteClick works correctly', async () => {
const wrapper = shallowMount(ApiKeysArea, {
store,
localVue,
});
wrapper.vm.onFirstDeleteClick();
await wrapper.vm.onFirstDeleteClick();
expect(wrapper.vm.$data.isDeleteClicked).toBe(true);
});
@ -163,18 +166,18 @@ describe('ApiKeysArea', () => {
expect(wrapper.vm.apiKeyCountTitle).toMatch('api keys');
});
it('function closeNewApiKeyPopup works correctly', () => {
it('function closeNewApiKeyPopup works correctly', async () => {
const wrapper = shallowMount(ApiKeysArea, {
store,
localVue,
});
wrapper.vm.closeNewApiKeyPopup();
await wrapper.vm.closeNewApiKeyPopup();
expect(wrapper.vm.$data.isNewApiKeyPopupShown).toBe(false);
});
it('function showCopyApiKeyPopup works correctly', () => {
it('function showCopyApiKeyPopup works correctly', async () => {
const wrapper = shallowMount(ApiKeysArea, {
store,
localVue,
@ -182,30 +185,30 @@ describe('ApiKeysArea', () => {
const testSecret = 'testSecret';
wrapper.vm.showCopyApiKeyPopup(testSecret);
await wrapper.vm.showCopyApiKeyPopup(testSecret);
expect(wrapper.vm.$data.isCopyApiKeyPopupShown).toBe(true);
expect(wrapper.vm.$data.apiKeySecret).toMatch('testSecret');
});
it('function closeCopyNewApiKeyPopup works correctly', () => {
it('function closeCopyNewApiKeyPopup works correctly', async () => {
const wrapper = shallowMount(ApiKeysArea, {
store,
localVue,
});
wrapper.vm.closeCopyNewApiKeyPopup();
await wrapper.vm.closeCopyNewApiKeyPopup();
expect(wrapper.vm.$data.isCopyApiKeyPopupShown).toBe(false);
});
it('action on onDelete with name works correctly', () => {
it('action on onDelete with name works correctly', async () => {
const wrapper = shallowMount(ApiKeysArea, {
store,
localVue,
});
wrapper.vm.onDelete();
await wrapper.vm.onDelete();
expect(wrapper.vm.$data.isDeleteClicked).toBe(false);
});

View File

@ -31,13 +31,13 @@ describe('ApiKeysCopyPopup', () => {
expect(wrapper).toMatchSnapshot();
});
it('function onCloseClick works correctly', () => {
it('function onCloseClick works correctly', async () => {
const wrapper = mount(ApiKeysCopyPopup, {
store,
localVue,
});
wrapper.vm.onCloseClick();
await wrapper.vm.onCloseClick();
expect(wrapper.emitted()).toEqual({'closePopup': [[]]});
});

View File

@ -42,32 +42,29 @@ exports[`ApiKeysArea renders empty screen with add key prompt 1`] = `
<div class="api-keys-area__container">
<apikeyscreationpopup-stub></apikeyscreationpopup-stub>
<apikeyscopypopup-stub apikeysecret=""></apikeyscopypopup-stub>
<div class="api-keys-header">
<vheader-stub placeholder="API Key" search="function () { [native code] }">
<div class="header-default-state">
<vbutton-stub label="+Create API Key" width="180px" height="48px" onpress="function () { [native code] }" class="button"></vbutton-stub>
</div>
<!---->
<!---->
</vheader-stub>
<!---->
<!---->
</div>
<div class="api-keys-items">
<sortingheader-stub onheaderclickcallback="function () { [native code] }"></sortingheader-stub>
<div class="api-keys-items__content">
<vlist-stub itemcomponent="function VueComponent (options) {
this._init(options);
}" onitemclick="function () { [native code] }" dataset="[object Object],[object Object]"></vlist-stub>
</div>
<!---->
<p class="api-keys-items__additional-info">Want to give limited access? <b>Use API Keys.</b></p>
</div>
<!---->
<!---->
<!---->
<emptystate-stub maintitle="Let's create your first API Key" additionaltext="<p>API keys give access to the project allowing you to create buckets, upload files, and read them. Once youve created an API key, youre ready to interact with the network through our Uplink CLI.</p>" imagesource="<svg width=&quot;346&quot; height=&quot;273&quot; viewBox=&quot;0 0 346 273&quot; fill=&quot;none&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;>
<path d=&quot;M199.593 272.163C274.583 272.163 335.34 211.215 335.34 136.034C335.34 60.8521 274.583 0 199.593 0C124.602 0 63.8457 60.9476 63.8457 136.129C63.8457 211.311 124.602 272.163 199.593 272.163Z&quot; fill=&quot;#E8EAF2&quot;/>
<path d=&quot;M274.391 209.88H126.512C120.016 209.88 114.666 204.53 114.666 198.034V80.5331C114.666 74.0371 120.016 68.6875 126.512 68.6875H274.295C280.791 68.6875 286.141 74.0371 286.141 80.5331V198.034C286.141 204.53 280.887 209.88 274.391 209.88Z&quot; fill=&quot;#8F96AD&quot;/>
<path d=&quot;M267.036 197.371H135.875C132.34 197.371 129.379 194.409 129.379 190.875V90.9511C129.379 87.4165 132.34 84.4551 135.875 84.4551H267.036C270.571 84.4551 273.532 87.4165 273.532 90.9511V190.875C273.532 194.409 270.571 197.371 267.036 197.371Z&quot; fill=&quot;white&quot;/>
<path d=&quot;M183.639 188.771C182.875 188.771 182.206 188.102 182.206 187.338V93.9105C182.206 93.1462 182.875 92.4775 183.639 92.4775C184.403 92.4775 185.072 93.1462 185.072 93.9105V187.338C185.072 188.102 184.403 188.771 183.639 188.771Z&quot; fill=&quot;#ABB0C1&quot;/>
<path d=&quot;M217.838 155.908L195.007 139.191L217.838 120.658C218.507 120.085 218.603 119.13 218.029 118.461C217.456 117.792 216.501 117.697 215.832 118.27L191.568 138.044C191.186 138.331 190.995 138.809 190.995 139.286C190.995 139.764 191.281 140.242 191.663 140.528L216.119 158.392C216.405 158.583 216.692 158.679 217.074 158.679C217.552 158.679 218.029 158.488 218.316 158.01C218.698 157.341 218.507 156.386 217.838 155.908Z&quot; fill=&quot;#8F96AD&quot;/>
<path d=&quot;M266.272 138.042L241.816 118.172C241.147 117.599 240.192 117.695 239.619 118.363C239.046 119.032 239.141 119.987 239.81 120.56L262.642 139.093L239.81 155.811C239.141 156.288 238.95 157.244 239.523 158.008C239.81 158.39 240.288 158.677 240.765 158.677C241.052 158.677 241.434 158.581 241.721 158.39L266.176 140.526C266.558 140.24 266.749 139.762 266.845 139.284C266.845 138.807 266.654 138.329 266.272 138.042Z&quot; fill=&quot;#8F96AD&quot;/>
<path d=&quot;M233.218 113.779C232.358 113.588 231.594 114.161 231.403 115.021L222.423 162.977C222.232 163.836 222.805 164.601 223.665 164.792C223.856 164.792 224.047 164.792 224.238 164.792C224.811 164.696 225.384 164.218 225.48 163.55L234.46 115.594C234.651 114.83 234.078 113.97 233.218 113.779Z&quot; fill=&quot;#8F96AD&quot;/>
<path d=&quot;M181.059 81.1043H132.434C130.524 81.1043 128.9 79.4803 128.9 77.5697C128.9 75.6591 130.524 74.0352 132.434 74.0352H181.059C182.969 74.0352 184.593 75.6591 184.593 77.5697C184.593 79.4803 183.065 81.1043 181.059 81.1043Z&quot; fill=&quot;white&quot;/>
<path fill-rule=&quot;evenodd&quot; clip-rule=&quot;evenodd&quot; d=&quot;M342.789 176.059C344.605 176.059 345.942 177.492 345.942 179.307C345.082 203.953 334.67 226.211 318.334 242.547C301.999 258.882 279.74 269.295 255.094 270.155C253.279 270.25 251.846 268.817 251.846 267.002V239.012C251.846 237.293 253.183 235.955 254.903 235.86C270.187 235.096 283.943 228.504 294.165 218.378C304.387 208.156 310.883 194.4 311.647 179.116C311.743 177.396 313.08 176.059 314.799 176.059H342.789Z&quot; fill=&quot;#B0B6C9&quot;/>
<path d=&quot;M253.281 262.994C259.401 262.994 264.362 258.033 264.362 251.912C264.362 245.792 259.401 240.831 253.281 240.831C247.161 240.831 242.2 245.792 242.2 251.912C242.2 258.033 247.161 262.994 253.281 262.994Z&quot; fill=&quot;#8F96AD&quot;/>
<path d=&quot;M73.017 36.1123C81.137 36.1123 87.824 29.2342 87.824 20.8276C87.824 12.4211 81.137 5.54297 73.017 5.54297C64.897 5.54297 58.21 12.4211 58.21 20.8276C58.1145 29.3297 64.8015 36.1123 73.017 36.1123Z&quot; fill=&quot;#8F96AD&quot;/>
<path d=&quot;M73.0181 27.5157C76.6482 27.5157 79.7051 24.5543 79.7051 20.8286C79.7051 17.1985 76.7437 14.1416 73.0181 14.1416C69.388 14.1416 66.3311 17.103 66.3311 20.8286C66.3311 24.5543 69.2925 27.5157 73.0181 27.5157Z&quot; fill=&quot;white&quot;/>
<path fill-rule=&quot;evenodd&quot; clip-rule=&quot;evenodd&quot; d=&quot;M156.51 42.5093C159.949 42.5093 162.815 39.6434 162.815 36.2043C162.815 32.7653 159.949 29.8994 156.51 29.8994C153.071 29.8994 150.205 32.7653 150.205 36.2043C150.11 39.6434 152.976 42.5093 156.51 42.5093Z&quot; fill=&quot;#8F96AD&quot;/>
<path fill-rule=&quot;evenodd&quot; clip-rule=&quot;evenodd&quot; d=&quot;M113.904 242.359C117.343 242.359 120.209 239.493 120.209 236.054C120.209 232.615 117.343 229.749 113.904 229.749C110.465 229.749 107.599 232.615 107.599 236.054C107.599 239.589 110.369 242.359 113.904 242.359Z&quot; fill=&quot;white&quot;/>
<path fill-rule=&quot;evenodd&quot; clip-rule=&quot;evenodd&quot; d=&quot;M132.055 242.359C135.494 242.359 138.36 239.493 138.36 236.054C138.36 232.615 135.494 229.749 132.055 229.749C128.616 229.749 125.75 232.615 125.75 236.054C125.654 239.589 128.52 242.359 132.055 242.359Z&quot; fill=&quot;white&quot;/>
<path fill-rule=&quot;evenodd&quot; clip-rule=&quot;evenodd&quot; d=&quot;M150.111 242.359C153.55 242.359 156.416 239.493 156.416 236.054C156.416 232.615 153.55 229.749 150.111 229.749C146.672 229.749 143.806 232.615 143.806 236.054C143.806 239.589 146.672 242.359 150.111 242.359Z&quot; fill=&quot;#8F96AD&quot;/>
<path d=&quot;M140.078 128.585H157.942C159.757 128.585 161.286 127.152 161.286 125.433C161.286 123.713 159.757 122.28 157.942 122.28H140.078C138.263 122.28 136.735 123.713 136.735 125.433C136.735 127.152 138.263 128.585 140.078 128.585Z&quot; fill=&quot;#B0B6C9&quot;/>
<path d=&quot;M139.982 115.976H171.315C173.131 115.976 174.659 114.352 174.659 112.442C174.659 110.531 173.131 108.907 171.315 108.907H140.077C138.262 108.907 136.734 110.531 136.734 112.442C136.734 114.352 138.167 115.976 139.982 115.976Z&quot; fill=&quot;#B0B6C9&quot;/>
<path d=&quot;M141.606 146.546H143.707C145.522 146.546 147.051 144.922 147.051 143.011C147.051 141.005 145.618 139.477 143.707 139.477H141.606C139.791 139.477 138.262 141.101 138.262 143.011C138.358 145.017 139.791 146.546 141.606 146.546Z&quot; fill=&quot;#8F96AD&quot;/>
<path d=&quot;M154.216 146.546H156.317C158.132 146.546 159.661 144.922 159.661 143.011C159.661 141.005 158.228 139.477 156.317 139.477H154.216C152.401 139.477 150.872 141.101 150.872 143.011C150.968 145.017 152.401 146.546 154.216 146.546Z&quot; fill=&quot;#8F96AD&quot;/>
<path d=&quot;M126.229 158.861C125.787 158.861 125.433 158.861 125.079 158.949C124.372 159.037 123.665 158.598 123.4 157.983C115.091 142.97 99.0028 132.786 80.4398 132.786C63.6447 132.786 48.7943 141.127 40.0431 153.857C39.6011 154.471 38.8056 154.735 38.0984 154.647C35.8885 154.208 33.5903 153.944 31.292 153.944C13.9665 153.857 0 167.553 0 184.585C0 184.585 0 184.585 0 184.672C0 185.638 0.795558 186.428 1.8563 186.428H150.449C151.421 186.428 152.305 185.638 152.305 184.672V184.585C152.305 170.362 140.637 158.861 126.229 158.861Z&quot; fill=&quot;#B0B6C9&quot;/>
</svg>" isbuttonshown="true" onbuttonclick="function () { [native code] }" buttonlabel="Create an API Key"></emptystate-stub>
</div>
</div>
`;

View File

@ -64,16 +64,16 @@ describe('HeaderedInput.vue', () => {
expect(wrapper.find('.label-container').text()).toMatch(error);
});
it('emit setData on input correctly', () => {
it('emit setData on input correctly', async () => {
const testData = 'testData';
const wrapper = mount(HeaderedInput);
wrapper.find('input').trigger('input');
await wrapper.find('input').trigger('input');
expect(wrapper.emitted('setData').length).toEqual(1);
wrapper.vm.$emit('setData', testData);
await wrapper.vm.$emit('setData', testData);
expect(wrapper.emitted('setData')[1][0]).toEqual(testData);
});

View File

@ -8,42 +8,42 @@ import { mount } from '@vue/test-utils';
const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
describe('VDatePicker.vue', () => {
it('renders correctly', function () {
it('renders correctly', async () => {
const wrapper = mount(VDatePicker, {});
wrapper.vm.showCheck();
await wrapper.vm.showCheck();
expect(wrapper.findAll('li').at(0).text()).toBe('Mo');
expect(wrapper.findAll('.day').length).toBe(42);
wrapper.vm.showYear();
await wrapper.vm.showYear();
expect(wrapper.findAll('.year').length).toBe(100);
wrapper.vm.showMonth();
await wrapper.vm.showMonth();
expect(wrapper.findAll('.month').length).toBe(12);
});
it('renders correctly with props', function () {
it('renders correctly with props', async () => {
const wrapper = mount(VDatePicker, {
propsData: {
isSundayFirst: true,
},
});
wrapper.vm.showCheck();
await wrapper.vm.showCheck();
expect(wrapper.findAll('li').at(0).text()).toBe('Su');
expect(wrapper.findAll('.day').length).toBe(42);
});
it('triggers correct functionality on normal check', function () {
it('triggers correct functionality on normal check', async () => {
const wrapper = mount(VDatePicker);
wrapper.vm.showCheck();
wrapper.vm.setYear(2019);
wrapper.vm.setMonth(months[9]);
await wrapper.vm.showCheck();
await wrapper.vm.setYear(2019);
await wrapper.vm.setMonth(months[9]);
wrapper.findAll('.day').at(1).trigger('click');
@ -58,12 +58,12 @@ describe('VDatePicker.vue', () => {
expect(wrapper.vm.selectedDays.length).toBe(0);
});
it('triggers correct functionality on toggle checking', function () {
it('triggers correct functionality on toggle checking', async () => {
const wrapper = mount(VDatePicker);
wrapper.vm.showCheck();
wrapper.vm.setYear(2019);
wrapper.vm.setMonth(months[9]);
await wrapper.vm.showCheck();
await wrapper.vm.setYear(2019);
await wrapper.vm.setMonth(months[9]);
wrapper.findAll('.day').at(1).trigger('click');
@ -86,56 +86,56 @@ describe('VDatePicker.vue', () => {
expect(selectedDay2.getFullYear()).toBe(2019);
});
it('triggers correct functionality on month selection', function () {
it('triggers correct functionality on month selection', async () => {
const wrapper = mount(VDatePicker);
wrapper.vm.showCheck();
wrapper.vm.setYear(2019);
wrapper.vm.setMonth(months[9]);
await wrapper.vm.showCheck();
await wrapper.vm.setYear(2019);
await wrapper.vm.setMonth(months[9]);
expect(wrapper.findAll('.month').length).toBe(0);
wrapper.find('.month-selection').trigger('click');
await wrapper.find('.month-selection').trigger('click');
expect(wrapper.findAll('.month').length).toBe(12);
wrapper.findAll('.month').at(0).trigger('click');
await wrapper.findAll('.month').at(0).trigger('click');
expect(wrapper.vm.selectedDateState.month).toBe(0);
expect(wrapper.find('.month-selection').text()).toBe(months[0]);
});
it('triggers correct functionality on year selection', function () {
it('triggers correct functionality on year selection', async () => {
const wrapper = mount(VDatePicker);
const now = new Date();
const nowYear = now.getFullYear();
wrapper.vm.showCheck();
wrapper.vm.setYear(2019);
wrapper.vm.setMonth(months[9]);
await wrapper.vm.showCheck();
await wrapper.vm.setYear(2019);
await wrapper.vm.setMonth(months[9]);
expect(wrapper.findAll('.year').length).toBe(0);
wrapper.find('.year-selection').trigger('click');
await wrapper.find('.year-selection').trigger('click');
expect(wrapper.findAll('.year').length).toBe(100);
expect(wrapper.findAll('.year').at(0).text()).toBe(nowYear.toString());
wrapper.find('.year-selection').trigger('click');
wrapper.findAll('.year').at(1).trigger('click');
await wrapper.find('.year-selection').trigger('click');
await wrapper.findAll('.year').at(1).trigger('click');
expect(wrapper.vm.selectedDateState.year).toBe(nowYear - 1);
expect(wrapper.find('.year-selection').text()).toBe((nowYear - 1).toString());
});
it('triggers correct functionality on month incrementation', function () {
it('triggers correct functionality on month incrementation', async () => {
const wrapper = mount(VDatePicker);
const now = new Date();
const nowYear = now.getFullYear();
wrapper.vm.showCheck();
wrapper.vm.setYear(nowYear);
wrapper.vm.setMonth(months[now.getMonth() - 1]);
await wrapper.vm.showCheck();
await wrapper.vm.setYear(nowYear);
await wrapper.vm.setMonth(months[now.getMonth() - 1]);
const actualDates = wrapper.findAll('.day');
@ -165,12 +165,12 @@ describe('VDatePicker.vue', () => {
expect(wrapper.vm.selectedDateState.month).toBe(2);
});
it('triggers correct functionality on month decrementation', function () {
it('triggers correct functionality on month decrementation', async () => {
const wrapper = mount(VDatePicker);
wrapper.vm.showCheck();
wrapper.vm.setYear(2019);
wrapper.vm.setMonth(months[9]);
await wrapper.vm.showCheck();
await wrapper.vm.setYear(2019);
await wrapper.vm.setMonth(months[9]);
wrapper.findAll('.day').at(0).trigger('click');

View File

@ -25,7 +25,7 @@ describe('Pagination.vue', () => {
expect(wrapper).toMatchSnapshot();
});
it('inits correctly with totalPageCount equals 10 and current pageNumber in first block', () => {
it('inits correctly with totalPageCount equals 10 and current pageNumber in first block', async () => {
const wrapper = mount(Pagination, {
propsData: {
totalPageCount: 10,
@ -33,7 +33,7 @@ describe('Pagination.vue', () => {
},
});
const wrapperData = wrapper.vm.$data;
const wrapperData = await wrapper.vm.$data;
expect(wrapperData.currentPageNumber).toBe(1);
expect(wrapperData.pagesArray.length).toBe(10);
@ -70,9 +70,9 @@ describe('Pagination.vue', () => {
},
});
const wrapperData = wrapper.vm.$data;
const wrapperData = await wrapper.vm.$data;
wrapper.findAll('span').at(2).trigger('click');
await wrapper.findAll('span').at(2).trigger('click');
await expect(callbackSpy.callCount).toBe(1);
expect(wrapperData.currentPageNumber).toBe(3);
@ -201,7 +201,7 @@ describe('Pagination.vue', () => {
expect(wrapper.vm.$data.currentPageNumber).toBe(2);
wrapper.setProps({totalPageCount: 7});
await wrapper.setProps({totalPageCount: 7});
const wrapperData = wrapper.vm.$data;

View File

@ -27,10 +27,11 @@ exports[`Pagination.vue renders correctly with props 1`] = `
<paginationlefticon-stub class="pagination-container__button__image"></paginationlefticon-stub>
</div>
<div class="pagination-container__items">
<pagesblock-stub pages="[object Object],[object Object],[object Object]" isselected="function () { [native code] }"></pagesblock-stub> <span class="pages-divider">...</span>
<pagesblock-stub pages="" isselected="function () { [native code] }"></pagesblock-stub>
<!---->
<pagesblock-stub pages="[object Object]" isselected="function () { [native code] }"></pagesblock-stub>
<pagesblock-stub pages="" isselected="function () { [native code] }"></pagesblock-stub>
<!---->
<pagesblock-stub pages="" isselected="function () { [native code] }"></pagesblock-stub>
</div>
<div class="pagination-container__button">
<paginationrighticon-stub class="pagination-container__button__image"></paginationrighticon-stub>

View File

@ -87,33 +87,33 @@ describe('NavigationArea', () => {
});
});
it('trigger show/hide events works correctly', () => {
it('trigger show/hide events works correctly', async () => {
const wrapper = shallowMount(NavigationArea, {
store,
localVue,
});
wrapper.find('.navigation-area__resources-title').trigger('mouseenter');
wrapper.find('.navigation-area__account-title').trigger('mouseenter');
await wrapper.find('.navigation-area__resources-title').trigger('mouseenter');
await wrapper.find('.navigation-area__account-title').trigger('mouseenter');
expect(wrapper.find('.navigation-area__resources-title__button').text()).toMatch('Hide');
wrapper.find('.navigation-area__resources-title__button').trigger('click');
await wrapper.find('.navigation-area__resources-title__button').trigger('click');
expect(wrapper.find('.navigation-area__account-title__button').text()).toMatch('Hide');
wrapper.find('.navigation-area__account-title__button').trigger('click');
await wrapper.find('.navigation-area__account-title__button').trigger('click');
expect(wrapper.find('.navigation-area__resources-title__button').text()).toMatch('Show');
expect(wrapper.find('.navigation-area__account-title__button').text()).toMatch('Show');
expect(wrapper.findAll('.navigation-area__item-container').length).toBe(4);
wrapper.find('.navigation-area__resources-title__button').trigger('click');
wrapper.find('.navigation-area__account-title__button').trigger('click');
await wrapper.find('.navigation-area__resources-title__button').trigger('click');
await wrapper.find('.navigation-area__account-title__button').trigger('click');
expect(wrapper.findAll('.navigation-area__item-container').length).toBe(9);
wrapper.find('.navigation-area__resources-title').trigger('mouseleave');
wrapper.find('.navigation-area__account-title').trigger('mouseleave');
await wrapper.find('.navigation-area__resources-title').trigger('mouseleave');
await wrapper.find('.navigation-area__account-title').trigger('mouseleave');
expect(wrapper.findAll('.navigation-area__resources-title__button').length).toBe(0);
expect(wrapper.findAll('.navigation-area__account-title__button').length).toBe(0);

View File

@ -6,12 +6,15 @@ import Vuex from 'vuex';
import ProjectLimitsArea from '@/components/project/ProjectLimitsArea.vue';
import { makeProjectsModule } from '@/store/modules/projects';
import { NotificatorPlugin } from '@/utils/plugins/notificator';
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { ProjectsApiMock } from '../../mock/api/projects';
const localVue = createLocalVue();
const notificationPlugin = new NotificatorPlugin();
localVue.use(Vuex);
localVue.use(notificationPlugin);
const projectsApi = new ProjectsApiMock();
const projectsModule = makeProjectsModule(projectsApi);

View File

@ -29,12 +29,11 @@ exports[`Notification.vue renders correctly with props 1`] = `
`;
exports[`Notification.vue renders correctly with props 2`] = `
<div class="notification-wrap" style="background-color: rgb(255, 212, 210);">
<div class="notification-wrap" style="background-color: rgb(219, 241, 211);">
<div class="notification-wrap__text-area">
<div class="notification-wrap__text-area__image"><svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="40" height="40" rx="10" fill="#EB5757"></rect>
<path d="M20.5 22.75C21.7676 22.75 22.8047 21.645 22.8047 20.2944V10.4556C22.8047 10.3328 22.797 10.2019 22.7816 10.0791C22.6126 8.90857 21.6523 8 20.5 8C19.2324 8 18.1953 9.10502 18.1953 10.4556V20.2862C18.1953 21.645 19.2324 22.75 20.5 22.75Z" fill="#F5F5F9"></path>
<path d="M20.5 25.1465C18.7146 25.1465 17.2734 26.5877 17.2734 28.373C17.2734 30.1584 18.7146 31.5996 20.5 31.5996C22.2853 31.5996 23.7265 30.1584 23.7265 28.373C23.7337 26.5877 22.2925 25.1465 20.5 25.1465Z" fill="#F5F5F9"></path>
<rect width="40" height="40" rx="10" fill="#95D486"></rect>
<path d="M27.7625 17.0601C28.348 16.4741 28.3475 15.5243 27.7614 14.9388C27.1753 14.3533 26.2256 14.3538 25.6401 14.9399L27.7625 17.0601ZM17.7003 25.01L16.6396 26.0707C16.921 26.3521 17.3027 26.5101 17.7007 26.51C18.0986 26.5099 18.4802 26.3517 18.7615 26.0701L17.7003 25.01ZM16.0607 21.249C15.4749 20.6633 14.5251 20.6633 13.9393 21.249C13.3536 21.8348 13.3536 22.7846 13.9393 23.3704L16.0607 21.249ZM25.6401 14.9399L16.6391 23.9499L18.7615 26.0701L27.7625 17.0601L25.6401 14.9399ZM18.761 23.9493L16.0607 21.249L13.9393 23.3704L16.6396 26.0707L18.761 23.9493Z" fill="white"></path>
</svg>
</div>
<p class="notification-wrap__text-area__message">testMessage</p>
@ -44,11 +43,11 @@ exports[`Notification.vue renders correctly with props 2`] = `
`;
exports[`Notification.vue renders correctly with props 3`] = `
<div class="notification-wrap" style="background-color: rgb(208, 227, 254);">
<div class="notification-wrap" style="background-color: rgb(219, 241, 211);">
<div class="notification-wrap__text-area">
<div class="notification-wrap__text-area__image"><svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="40" height="40" rx="10" fill="#2683FF"></rect>
<path d="M18.1489 17.043H21.9149V28H18.1489V17.043ZM20 12C20.5816 12 21.0567 12.1823 21.4255 12.5468C21.8085 12.8979 22 13.357 22 13.9241C22 14.4776 21.8085 14.9367 21.4255 15.3013C21.0567 15.6658 20.5816 15.8481 20 15.8481C19.4184 15.8481 18.9362 15.6658 18.5532 15.3013C18.1844 14.9367 18 14.4776 18 13.9241C18 13.357 18.1844 12.8979 18.5532 12.5468C18.9362 12.1823 19.4184 12 20 12Z" fill="#F5F6FA"></path>
<rect width="40" height="40" rx="10" fill="#95D486"></rect>
<path d="M27.7625 17.0601C28.348 16.4741 28.3475 15.5243 27.7614 14.9388C27.1753 14.3533 26.2256 14.3538 25.6401 14.9399L27.7625 17.0601ZM17.7003 25.01L16.6396 26.0707C16.921 26.3521 17.3027 26.5101 17.7007 26.51C18.0986 26.5099 18.4802 26.3517 18.7615 26.0701L17.7003 25.01ZM16.0607 21.249C15.4749 20.6633 14.5251 20.6633 13.9393 21.249C13.3536 21.8348 13.3536 22.7846 13.9393 23.3704L16.0607 21.249ZM25.6401 14.9399L16.6391 23.9499L18.7615 26.0701L27.7625 17.0601L25.6401 14.9399ZM18.761 23.9493L16.0607 21.249L13.9393 23.3704L16.6396 26.0707L18.761 23.9493Z" fill="white"></path>
</svg>
</div>
<p class="notification-wrap__text-area__message">testMessage</p>
@ -58,10 +57,11 @@ exports[`Notification.vue renders correctly with props 3`] = `
`;
exports[`Notification.vue renders correctly with props 4`] = `
<div class="notification-wrap" style="background-color: rgb(252, 248, 227);">
<div class="notification-wrap" style="background-color: rgb(219, 241, 211);">
<div class="notification-wrap__text-area">
<div class="notification-wrap__text-area__image"><svg width="36" height="34" viewBox="0 0 36 34" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M35.028 27.9606C34.5358 27.0512 34.0405 26.1403 33.5467 25.2262C32.628 23.5309 31.7108 21.8356 30.7936 20.1402C29.6921 18.109 28.5936 16.0746 27.4936 14.0434C26.4311 12.0825 25.3717 10.1247 24.3093 8.16544C23.528 6.7248 22.7499 5.28264 21.9686 3.84064C21.7577 3.45002 21.5467 3.0594 21.3358 2.67188C21.1171 2.26564 20.8858 1.875 20.5546 1.54376C19.3983 0.379681 17.4796 0.156241 16.089 1.03596C15.4921 1.41408 15.0609 1.95004 14.7296 2.56408C14.2218 3.5016 13.714 4.43908 13.2062 5.37972C12.2812 7.09064 11.3546 8.8016 10.4296 10.5125C9.31555 12.5547 8.21087 14.6017 7.10151 16.6485C6.05151 18.5892 4.99995 20.5266 3.94839 22.4689C3.17963 23.8908 2.40931 25.3096 1.63903 26.7313C1.4359 27.1063 1.23279 27.4813 1.02967 27.8563C0.745289 28.3844 0.521865 28.9188 0.451545 29.5282C0.253109 31.2501 1.45935 32.947 3.12655 33.3688C3.56719 33.4813 4.00155 33.486 4.44687 33.486H31.9469H31.9906C32.8969 33.4673 33.7563 33.1267 34.4203 32.5095C35.0609 31.9157 35.4359 31.1032 35.5422 30.2438C35.6437 29.4345 35.4094 28.6688 35.0281 27.961L35.028 27.9606ZM16.4372 10.9526C16.4372 10.0776 17.1528 9.42916 17.9997 9.39012C18.8434 9.35106 19.5621 10.137 19.5621 10.9526V21.9558C19.5621 22.8308 18.8465 23.4792 17.9997 23.5183C17.1559 23.5573 16.4372 22.7714 16.4372 21.9558V10.9526ZM17.9997 28.8402C17.1215 28.8402 16.409 28.1293 16.409 27.2496C16.409 26.3714 17.1199 25.6589 17.9997 25.6589C18.8778 25.6589 19.5903 26.3698 19.5903 27.2496C19.5903 28.1277 18.8778 28.8402 17.9997 28.8402Z" fill="#F4D638"></path>
<div class="notification-wrap__text-area__image"><svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="40" height="40" rx="10" fill="#95D486"></rect>
<path d="M27.7625 17.0601C28.348 16.4741 28.3475 15.5243 27.7614 14.9388C27.1753 14.3533 26.2256 14.3538 25.6401 14.9399L27.7625 17.0601ZM17.7003 25.01L16.6396 26.0707C16.921 26.3521 17.3027 26.5101 17.7007 26.51C18.0986 26.5099 18.4802 26.3517 18.7615 26.0701L17.7003 25.01ZM16.0607 21.249C15.4749 20.6633 14.5251 20.6633 13.9393 21.249C13.3536 21.8348 13.3536 22.7846 13.9393 23.3704L16.0607 21.249ZM25.6401 14.9399L16.6391 23.9499L18.7615 26.0701L27.7625 17.0601L25.6401 14.9399ZM18.761 23.9493L16.0607 21.249L13.9393 23.3704L16.6396 26.0707L18.761 23.9493Z" fill="white"></path>
</svg>
</div>
<p class="notification-wrap__text-area__message">testMessage</p>

View File

@ -92,7 +92,7 @@ describe('Team HeaderArea', () => {
expect(wrapper.findAll('.blur-search').length).toBe(0);
});
it('renders correctly with 2 selected users and delete clicked once', () => {
it('renders correctly with 2 selected users and delete clicked once', async () => {
store.dispatch(APP_STATE_ACTIONS.TOGGLE_TEAM_MEMBERS);
const selectedUsersCount = 2;
@ -106,7 +106,7 @@ describe('Team HeaderArea', () => {
},
});
wrapper.vm.onFirstDeleteClick();
await wrapper.vm.onFirstDeleteClick();
expect(wrapper).toMatchSnapshot();
expect(wrapper.vm.selectedProjectMembersCount).toBe(selectedUsersCount);
@ -119,7 +119,7 @@ describe('Team HeaderArea', () => {
expect(expectedSectionRendered.text()).toBe(`Are you sure you want to delete ${selectedUsersCount} users?`);
});
it('renders correctly with 1 selected user and delete clicked once', () => {
it('renders correctly with 1 selected user and delete clicked once', async () => {
store.dispatch(APP_STATE_ACTIONS.TOGGLE_TEAM_MEMBERS);
const selectedUsersCount = 1;
@ -133,7 +133,7 @@ describe('Team HeaderArea', () => {
},
});
wrapper.vm.onFirstDeleteClick();
await wrapper.vm.onFirstDeleteClick();
expect(wrapper).toMatchSnapshot();
expect(wrapper.vm.selectedProjectMembersCount).toBe(selectedUsersCount);

View File

@ -121,7 +121,7 @@ describe('mutations', () => {
});
});
describe('actions', async () => {
describe('actions', () => {
beforeEach(() => {
jest.resetAllMocks();
});

View File

@ -17,6 +17,8 @@ import { User } from '@/types/users';
import { AuthToken } from '@/utils/authToken';
import { APP_STATE_ACTIONS } from '@/utils/constants/actionNames';
import { AppState } from '@/utils/constants/appStateEnum';
import { NotificatorPlugin } from '@/utils/plugins/notificator';
import { SegmentioPlugin } from '@/utils/plugins/segment';
import DashboardArea from '@/views/DashboardArea.vue';
import { createLocalVue, shallowMount } from '@vue/test-utils';
@ -29,7 +31,11 @@ import { ProjectUsageMock } from '../mock/api/usage';
import { UsersApiMock } from '../mock/api/users';
const localVue = createLocalVue();
const segmentioPlugin = new SegmentioPlugin();
const notificationPlugin = new NotificatorPlugin();
localVue.use(Vuex);
localVue.use(segmentioPlugin);
localVue.use(notificationPlugin);
const usersApi = new UsersApiMock();
const projectsApi = new ProjectsApiMock();