fix(refactor): add services/adapters/useCases

This commit is contained in:
2024-03-06 12:46:19 +03:00
parent e8609ee6d4
commit 4b6cda8632
25 changed files with 769 additions and 50 deletions

View File

@@ -12,5 +12,3 @@ describe("tests AppPageHeader component", () => {
expect(wrapper.exists()).toBe(true)
})
})

View File

@@ -7,7 +7,7 @@ describe("tests VTabulator component", () => {
vi.mock('tabulator-tables', () => {
const Tabulator = vi.fn(() => {
const tabulator = vi.fn(() => {
return {
getHtml: () => {
return '<div>test</div>'
@@ -17,7 +17,7 @@ describe("tests VTabulator component", () => {
return {
__esModule: true,
TabulatorFull: Tabulator
TabulatorFull: tabulator
}
})

View File

@@ -17,6 +17,13 @@ describe("tests SitesManagerPage component mounted with vuex", () => {
},
})
vi.mock('tabulator-tables', () => {
const mockTabulator = vi.fn().mockImplementation(() => ({
// Mock implementation details
}));
return { TabulatorFull: mockTabulator }; // Adjust based on what you're trying to mock
});
beforeEach(async () => {
store.dispatch('users/resetStore')
store.dispatch('services/resetStore')
@@ -47,12 +54,13 @@ describe("tests SitesManagerPage component mounted with vuex", () => {
test('test UsersManager mounted with vuex', async () => {
const wrapper = mount(UsersManager, {
shallow: true,
global: {
plugins: [store]
}
})
console.log(wrapper.html())
const componentState = wrapper.vm.componentState
const gridCols = wrapper.vm.gridCols
expect(componentState).toBe('view')

View File

@@ -8,7 +8,8 @@ import axios from "axios";
vi.mock('axios')
describe("tests SitesManagerPage component mounted with vuex", () => {
describe("tests App mounted with vuex", () => {
const store = createStore({
plugins: [],
modules: {
@@ -17,6 +18,8 @@ describe("tests SitesManagerPage component mounted with vuex", () => {
},
})
const mockData = [
{
"id": 1,
@@ -32,7 +35,6 @@ describe("tests SitesManagerPage component mounted with vuex", () => {
data: mockData,
})
test('tests App mounted with vuex', async () => {
const wrapper = mount(Sites, {
shallow: true,