mirror of
https://github.com/acedanger/finance.git
synced 2025-12-05 22:50:12 -08:00
Update import statements to use path aliases throughout codebase
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { AccountType, TransactionType, accountService, transactionService } from '@data/db.service';
|
||||
import { prisma } from '@data/prisma';
|
||||
import type { Account, Transaction } from '@types';
|
||||
import supertest from 'supertest';
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
|
||||
import { accountService, transactionService } from '../data/db.service';
|
||||
import { prisma } from '../data/prisma';
|
||||
|
||||
// Define a test server
|
||||
const BASE_URL = 'http://localhost:4322';
|
||||
@@ -34,7 +35,7 @@ describe('Database Integration Tests', () => {
|
||||
bankName: 'Test Bank',
|
||||
accountNumber: '123456',
|
||||
name: 'Test Account',
|
||||
type: 'CHECKING',
|
||||
type: AccountType.CHECKING,
|
||||
balance: 1000,
|
||||
notes: 'Created for automated testing',
|
||||
});
|
||||
@@ -90,7 +91,7 @@ describe('Database Integration Tests', () => {
|
||||
expect(response.body.length).toBeGreaterThan(0);
|
||||
|
||||
// Check if our test account is in the response
|
||||
const foundAccount = response.body.find((account: any) => account.id === testAccountId);
|
||||
const foundAccount = response.body.find((account: Account) => account.id === testAccountId);
|
||||
expect(foundAccount).toBeDefined();
|
||||
});
|
||||
|
||||
@@ -118,7 +119,7 @@ describe('Database Integration Tests', () => {
|
||||
description: 'Test Transaction',
|
||||
amount: -50.25,
|
||||
category: 'Testing',
|
||||
type: 'WITHDRAWAL',
|
||||
type: TransactionType.WITHDRAWAL,
|
||||
};
|
||||
|
||||
const response = await request
|
||||
@@ -145,7 +146,9 @@ describe('Database Integration Tests', () => {
|
||||
expect(Array.isArray(response.body)).toBe(true);
|
||||
|
||||
// Check if our test transaction is in the response
|
||||
const foundTransaction = response.body.find((txn: any) => txn.id === testTransactionId);
|
||||
const foundTransaction = response.body.find(
|
||||
(txn: Transaction) => txn.id === testTransactionId,
|
||||
);
|
||||
expect(foundTransaction).toBeDefined();
|
||||
expect(foundTransaction.description).toBe('Test Transaction');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user