Add .prettierrc.json and refactor test files for improved formatting consistency:
- Introduced `.prettierrc.json` to enforce consistent code formatting across the project. - Updated unit and e2e test files to address formatting issues, improve readability, and ensure alignment with the new Prettier configuration.
This commit is contained in:
@@ -3,14 +3,7 @@ import { computed, nextTick } from "vue";
|
||||
import { mount } from "@vue/test-utils";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
const {
|
||||
sharedVariablesRef,
|
||||
currentViewRef,
|
||||
startDateRef,
|
||||
endDateRef,
|
||||
queueRef,
|
||||
inProgressRef,
|
||||
} = vi.hoisted(() => {
|
||||
const { sharedVariablesRef, currentViewRef, startDateRef, endDateRef, queueRef, inProgressRef } = vi.hoisted(() => {
|
||||
const { ref } = require("vue");
|
||||
|
||||
return {
|
||||
@@ -78,44 +71,53 @@ vi.mock("@/components/session/token/SessionUser.vue", () => ({
|
||||
},
|
||||
}));
|
||||
|
||||
vi.mock("@/views/dashboards/superUserDashboard/InvoicingBillingPeriod/imports/InvoicingBillingPeriodImportView.vue", () => ({
|
||||
view: {
|
||||
variables: {
|
||||
currentView: currentViewRef,
|
||||
sharedVariables: sharedVariablesRef,
|
||||
},
|
||||
computed: {
|
||||
componentName: computed(() => currentViewRef.value),
|
||||
},
|
||||
functions: {
|
||||
filterExcluded: (transactions = []) => transactions.filter((transaction) => !transaction?.excluded),
|
||||
getCustomerViewTotalNetAmount: (customer) => {
|
||||
const transactions = Array.isArray(customer?.transactions) ? customer.transactions : [];
|
||||
return transactions.reduce((sum, transaction) => sum + Number(transaction?.amount ?? 0), 0);
|
||||
vi.mock(
|
||||
"@/views/dashboards/superUserDashboard/InvoicingBillingPeriod/imports/InvoicingBillingPeriodImportView.vue",
|
||||
() => ({
|
||||
view: {
|
||||
variables: {
|
||||
currentView: currentViewRef,
|
||||
sharedVariables: sharedVariablesRef,
|
||||
},
|
||||
computed: {
|
||||
componentName: computed(() => currentViewRef.value),
|
||||
},
|
||||
functions: {
|
||||
filterExcluded: (transactions = []) => transactions.filter((transaction) => !transaction?.excluded),
|
||||
getCustomerViewTotalNetAmount: (customer) => {
|
||||
const transactions = Array.isArray(customer?.transactions) ? customer.transactions : [];
|
||||
return transactions.reduce((sum, transaction) => sum + Number(transaction?.amount ?? 0), 0);
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}));
|
||||
})
|
||||
);
|
||||
|
||||
vi.mock("@/views/dashboards/superUserDashboard/InvoicingBillingPeriod/imports/InvoicingBillingPeriodImportDates.vue", () => ({
|
||||
dates: {
|
||||
variables: {
|
||||
start: startDateRef,
|
||||
end: endDateRef,
|
||||
vi.mock(
|
||||
"@/views/dashboards/superUserDashboard/InvoicingBillingPeriod/imports/InvoicingBillingPeriodImportDates.vue",
|
||||
() => ({
|
||||
dates: {
|
||||
variables: {
|
||||
start: startDateRef,
|
||||
end: endDateRef,
|
||||
},
|
||||
},
|
||||
},
|
||||
}));
|
||||
})
|
||||
);
|
||||
|
||||
vi.mock("@/views/dashboards/superUserDashboard/InvoicingBillingPeriod/imports/InvoicingBillingPeriodImportInvoiceQueue.vue", () => ({
|
||||
invoiceQueue: {
|
||||
addInvoiceCollectionsToQueue: vi.fn(),
|
||||
processInvoiceCollectionQueue: vi.fn(),
|
||||
invoiceCollectionQueue: queueRef,
|
||||
invoiceCollectionQueueInProgress: inProgressRef,
|
||||
invoiceCollectionQueueFailed: require("vue").ref([]),
|
||||
invoiceCollectionQueueSuccess: require("vue").ref([]),
|
||||
},
|
||||
}));
|
||||
vi.mock(
|
||||
"@/views/dashboards/superUserDashboard/InvoicingBillingPeriod/imports/InvoicingBillingPeriodImportInvoiceQueue.vue",
|
||||
() => ({
|
||||
invoiceQueue: {
|
||||
addInvoiceCollectionsToQueue: vi.fn(),
|
||||
processInvoiceCollectionQueue: vi.fn(),
|
||||
invoiceCollectionQueue: queueRef,
|
||||
invoiceCollectionQueueInProgress: inProgressRef,
|
||||
invoiceCollectionQueueFailed: require("vue").ref([]),
|
||||
invoiceCollectionQueueSuccess: require("vue").ref([]),
|
||||
},
|
||||
})
|
||||
);
|
||||
|
||||
import InvoicingBillingPeriodViewAll from "@/views/dashboards/superUserDashboard/InvoicingBillingPeriod/views/InvoicingBillingPeriodViewAll.vue";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user