feat: organize imports
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
gitea/salix-front/pipeline/head There was a failure building this commit Details

This commit is contained in:
Javier Segarra 2024-12-23 12:47:09 +01:00
parent 5b0479e60c
commit fcb2e3cc74
19 changed files with 48 additions and 26 deletions

View File

@ -1,5 +1,6 @@
import { vi, describe, expect, it, beforeAll } from 'vitest';
import { createWrapper, axios } from 'app/test/vitest/helper';
import axios from 'axios';
import { createWrapper } from 'app/test/vitest/helper';
import Leftmenu from 'components/LeftMenu.vue';
import { useNavigationStore } from 'src/stores/useNavigationStore';

View File

@ -1,4 +1,5 @@
import { createWrapper, axios } from 'app/test/vitest/helper';
import axios from 'axios';
import { createWrapper } from 'app/test/vitest/helper';
import VnChangePassword from 'src/components/common/VnChangePassword.vue';
import { vi, beforeEach, afterEach, beforeAll, describe, expect, it } from 'vitest';
import { Notify } from 'quasar';

View File

@ -1,5 +1,6 @@
import { vi, describe, expect, it, beforeAll, afterEach } from 'vitest';
import { createWrapper, axios } from 'app/test/vitest/helper';
import axios from 'axios';
import { createWrapper } from 'app/test/vitest/helper';
import VnLog from 'src/components/common/VnLog.vue';
describe('VnLog', () => {

View File

@ -1,5 +1,6 @@
import { vi, describe, expect, it, beforeAll, afterEach } from 'vitest';
import { createWrapper, axios } from 'app/test/vitest/helper';
import axios from 'axios';
import { createWrapper } from 'app/test/vitest/helper';
import VnPaginate from 'src/components/ui/VnPaginate.vue';
describe('VnPaginate', () => {

View File

@ -1,5 +1,5 @@
import { describe, it, expect, beforeAll, vi } from 'vitest';
import { axios } from 'app/test/vitest/helper';
import axios from 'axios';
import parsePhone from 'src/filters/parsePhone';
describe('parsePhone filter', () => {

View File

@ -1,5 +1,6 @@
import { vi, describe, expect, it, beforeAll, afterEach } from 'vitest';
import { createWrapper, axios } from 'app/test/vitest/helper';
import axios from 'axios';
import { createWrapper } from 'app/test/vitest/helper';
import VnSms from 'src/components/ui/VnSms.vue';
describe('VnSms', () => {

View File

@ -1,5 +1,5 @@
import { vi, describe, expect, it, beforeAll, afterAll } from 'vitest';
import { axios } from 'app/test/vitest/helper';
import axios from 'axios';
import { downloadFile } from 'src/composables/downloadFile';
import { useSession } from 'src/composables/useSession';
const session = useSession();

View File

@ -1,5 +1,7 @@
import { vi, describe, expect, it, beforeAll, afterAll } from 'vitest';
import { axios, flushPromises } from 'app/test/vitest/helper';
import axios from 'axios';
import { flushPromises } from '@vue/test-utils';
import { useAcl } from 'src/composables/useAcl';
describe('useAcl', () => {

View File

@ -1,5 +1,6 @@
import { describe, expect, it, beforeEach, afterEach, vi } from 'vitest';
import { axios, flushPromises } from 'app/test/vitest/helper';
import axios from 'axios';
import { flushPromises } from 'app/test/vitest/helper';
import { useArrayData } from 'composables/useArrayData';
import { useRouter } from 'vue-router';
import * as vueRouter from 'vue-router';
@ -25,8 +26,8 @@ describe('useArrayData', () => {
arrayData.fetch({});
await flushPromises();
const routerReplace = useRouter().replace.mock.calls[0][0];
let routerReplace = useRouter().replace;
routerReplace = routerReplace.mock.calls[0][0];
expect(axios.get.mock.calls[0][1].params).toEqual({
filter,
supplierFk: 2,

View File

@ -1,5 +1,6 @@
import { vi, describe, expect, it } from 'vitest';
import { axios, flushPromises } from 'app/test/vitest/helper';
import axios from 'axios';
import { flushPromises } from '@vue/test-utils';
import { useRole } from 'composables/useRole';
const role = useRole();
@ -31,10 +32,9 @@ describe('useRole', () => {
lang: 'en',
};
const expectedRoles = ['salesPerson', 'admin'];
vi.spyOn(axios, 'get')
.mockResolvedValueOnce({
vi.spyOn(axios, 'get').mockResolvedValueOnce({
data: { roles: rolesData, user: fetchedUser },
})
});
vi.spyOn(role.state, 'setUser');
vi.spyOn(role.state, 'setRoles');

View File

@ -1,5 +1,5 @@
import { vi, describe, expect, it, beforeAll, beforeEach } from 'vitest';
import { axios } from 'app/test/vitest/helper';
import axios from 'axios';
import { useSession } from 'composables/useSession';
import { useState } from 'composables/useState';

View File

@ -1,5 +1,6 @@
import { vi, describe, expect, it } from 'vitest';
import { axios, flushPromises } from 'app/test/vitest/helper';
import axios from 'axios';
import { flushPromises } from '@vue/test-utils';
import { useTokenConfig } from 'composables/useTokenConfig';
const tokenConfig = useTokenConfig();

View File

@ -1,5 +1,6 @@
import { vi, describe, expect, it, beforeAll, afterEach } from 'vitest';
import { createWrapper, axios } from 'app/test/vitest/helper';
import axios from 'axios';
import { createWrapper } from 'app/test/vitest/helper';
import ClaimDescriptorMenu from 'pages/Claim/Card/ClaimDescriptorMenu.vue';
describe('ClaimDescriptorMenu', () => {

View File

@ -1,5 +1,6 @@
import { vi, describe, expect, it, beforeAll, beforeEach, afterEach } from 'vitest';
import { createWrapper, axios } from 'app/test/vitest/helper';
import axios from 'axios';
import { createWrapper } from 'app/test/vitest/helper';
import ClaimLines from '/src/pages/Claim/Card/ClaimLines.vue';
describe('ClaimLines', () => {

View File

@ -1,5 +1,6 @@
import { vi, describe, expect, it, beforeAll, beforeEach, afterEach } from 'vitest';
import { createWrapper, axios } from 'app/test/vitest/helper';
import axios from 'axios';
import { createWrapper } from 'app/test/vitest/helper';
import ClaimLinesImport from 'pages/Claim/Card/ClaimLinesImport.vue';
describe('ClaimLinesImport', () => {

View File

@ -1,5 +1,6 @@
import { vi, describe, expect, it, beforeAll, afterEach } from 'vitest';
import { createWrapper, axios } from 'app/test/vitest/helper';
import axios from 'axios';
import { createWrapper } from 'app/test/vitest/helper';
import CustomerPayments from 'src/pages/Customer/Payments/CustomerPayments.vue';
describe('CustomerPayments', () => {

View File

@ -1,5 +1,6 @@
import { vi, describe, expect, it, beforeAll, afterEach } from 'vitest';
import { createWrapper, axios } from 'app/test/vitest/helper';
import axios from 'axios';
import { createWrapper } from 'app/test/vitest/helper';
import TicketBoxing from 'pages/Ticket/Card/TicketBoxing.vue';
// #4836 - Investigate how to test q-drawer outside
@ -21,7 +22,11 @@ describe('TicketBoxing', () => {
min: 1,
max: 2,
};
const videoList = ['2022-01-01T01-01-00.mp4', '2022-02-02T02-02-00.mp4', '2022-03-03T03-03-00.mp4'];
const videoList = [
'2022-01-01T01-01-00.mp4',
'2022-02-02T02-02-00.mp4',
'2022-03-03T03-03-00.mp4',
];
vi.spyOn(axios, 'get').mockResolvedValue({ data: videoList });
vi.spyOn(vm.quasar, 'notify');
@ -44,7 +49,9 @@ describe('TicketBoxing', () => {
await vm.getVideoList(expeditionId, timed);
expect(vm.quasar.notify).toHaveBeenCalledWith(expect.objectContaining({ type: 'negative' }));
expect(vm.quasar.notify).toHaveBeenCalledWith(
expect.objectContaining({ type: 'negative' })
);
});
});
});

View File

@ -1,5 +1,6 @@
import { vi, describe, expect, it, beforeAll, afterEach, beforeEach } from 'vitest';
import { createWrapper, axios } from 'app/test/vitest/helper';
import axios from 'axios';
import { createWrapper } from 'app/test/vitest/helper';
import TicketAdvance from 'pages/Ticket/TicketAdvance.vue';
import { Notify } from 'quasar';
import { nextTick } from 'vue';

View File

@ -1,5 +1,6 @@
import { vi, describe, expect, it, beforeAll, afterEach } from 'vitest';
import { createWrapper, axios } from 'app/test/vitest/helper';
import axios from 'axios';
import { createWrapper } from 'app/test/vitest/helper';
import WagonCreate from 'pages/Wagon/WagonCreate.vue';
describe('WagonCreate', () => {