Skip to content

Commit

Permalink
Really disable everything but bankaccounts
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Jun 24, 2024
1 parent afeee9a commit e796b0b
Show file tree
Hide file tree
Showing 7 changed files with 434 additions and 547 deletions.
2 changes: 1 addition & 1 deletion src/__tests__/bankaccounts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from "../../backend/database";
import { User } from "../../src/models/user";
import { BankAccount } from "../../src/models/bankaccount";
describe("BankAccounts", () => {
describe.only("BankAccounts", () => {
beforeEach(() => {
seedDatabase();
});
Expand Down
47 changes: 20 additions & 27 deletions src/__tests__/comments.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,24 @@ import {

import { User, Transaction } from "../../src/models";

describe.skip("Comments", () => {
beforeEach(() => {
seedDatabase();
});

it("should comment a transaction for a contact", () => {
const user: User = getAllUsers()[0];
const transactions: Transaction[] = getTransactionsForUserContacts(user.id);

const content = "This is my comment content";
const comment = createComment(user.id, transactions[0].id, content);

expect(comment.transactionId).toBe(transactions[0].id);
expect(comment.content).toBe(content);
});

it("should get a list of comments for a transaction", () => {
const user: User = getAllUsers()[0];
const transactions: Transaction[] = getTransactionsByUserId(user.id);
const transaction = transactions[0];

createComment(user.id, transaction.id, "This is my comment");

const comments = getCommentsByTransactionId(transaction.id);

expect(comments[0].transactionId).toBe(transaction.id);
});
describe("Comments", () => {
// beforeEach(() => {
// seedDatabase();
// });
// it("should comment a transaction for a contact", () => {
// const user: User = getAllUsers()[0];
// const transactions: Transaction[] = getTransactionsForUserContacts(user.id);
// const content = "This is my comment content";
// const comment = createComment(user.id, transactions[0].id, content);
// expect(comment.transactionId).toBe(transactions[0].id);
// expect(comment.content).toBe(content);
// });
// it("should get a list of comments for a transaction", () => {
// const user: User = getAllUsers()[0];
// const transactions: Transaction[] = getTransactionsByUserId(user.id);
// const transaction = transactions[0];
// createComment(user.id, transaction.id, "This is my comment");
// const comments = getCommentsByTransactionId(transaction.id);
// expect(comments[0].transactionId).toBe(transaction.id);
// });
});
78 changes: 33 additions & 45 deletions src/__tests__/contacts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,37 @@ import {
} from "../../backend/database";
import { User } from "../../src/models/user";
import { totalContacts, contactsPerUser } from "../../scripts/seedDataUtils";
describe.skip("Contacts", () => {
beforeEach(() => {
seedDatabase();
});

it("should retrieve a list of contacts", () => {
expect(getAllContacts().length).toEqual(totalContacts);
});

it("should retrieve a list of contacts for a username", () => {
const userToLookup: User = getAllUsers()[0];

const result = getContactsByUsername(userToLookup.username);
expect(result.length).toBeGreaterThanOrEqual(contactsPerUser);
expect(result[0].userId).toBe(userToLookup.id);
});

it("should retrieve a list of contacts for a userId", () => {
const userToLookup: User = getAllUsers()[0];

const result = getContactsByUserId(userToLookup.id);
expect(result.length).toBeGreaterThanOrEqual(3);
expect(result[0].userId).toBe(userToLookup.id);
});

it("should create a contact for user", () => {
const user: User = getRandomUser();
const contactToBe: User = getRandomUser();

const result = createContactForUser(user.id, contactToBe.id);
expect(result.userId).toBe(user.id);
});

it("should delete a contact", () => {
const userToLookup: User = getRandomUser();

const contacts = getContactsByUsername(userToLookup.username);

const contactId = contacts[0].id;

removeContactById(contactId);

const updatedContacts = getContactsByUsername(userToLookup.username);
expect(updatedContacts.length).toBeLessThan(contacts.length);
});
describe("Contacts", () => {
// beforeEach(() => {
// seedDatabase();
// });
// it("should retrieve a list of contacts", () => {
// expect(getAllContacts().length).toEqual(totalContacts);
// });
// it("should retrieve a list of contacts for a username", () => {
// const userToLookup: User = getAllUsers()[0];
// const result = getContactsByUsername(userToLookup.username);
// expect(result.length).toBeGreaterThanOrEqual(contactsPerUser);
// expect(result[0].userId).toBe(userToLookup.id);
// });
// it("should retrieve a list of contacts for a userId", () => {
// const userToLookup: User = getAllUsers()[0];
// const result = getContactsByUserId(userToLookup.id);
// expect(result.length).toBeGreaterThanOrEqual(3);
// expect(result[0].userId).toBe(userToLookup.id);
// });
// it("should create a contact for user", () => {
// const user: User = getRandomUser();
// const contactToBe: User = getRandomUser();
// const result = createContactForUser(user.id, contactToBe.id);
// expect(result.userId).toBe(user.id);
// });
// it("should delete a contact", () => {
// const userToLookup: User = getRandomUser();
// const contacts = getContactsByUsername(userToLookup.username);
// const contactId = contacts[0].id;
// removeContactById(contactId);
// const updatedContacts = getContactsByUsername(userToLookup.username);
// expect(updatedContacts.length).toBeLessThan(contacts.length);
// });
});
43 changes: 18 additions & 25 deletions src/__tests__/likes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,22 @@ import {

import { User, Transaction } from "../../src/models";

describe.skip("Transactions", () => {
beforeEach(() => {
seedDatabase();
});

it("should like a transaction for a contact", () => {
const user: User = getAllUsers()[0];
const transactions: Transaction[] = getTransactionsForUserContacts(user.id);

const like = createLike(user.id, transactions[0].id);

expect(like.transactionId).toBe(transactions[0].id);
});

it("should get a list of likes for a transaction", () => {
const user: User = getAllUsers()[0];
const transactions: Transaction[] = getTransactionsByUserId(user.id);
const transaction = transactions[0];

createLike(user.id, transaction.id);

const likes = getLikesByTransactionId(transaction.id);

expect(likes[0].transactionId).toBe(transaction.id);
});
describe("Transactions", () => {
// beforeEach(() => {
// seedDatabase();
// });
// it("should like a transaction for a contact", () => {
// const user: User = getAllUsers()[0];
// const transactions: Transaction[] = getTransactionsForUserContacts(user.id);
// const like = createLike(user.id, transactions[0].id);
// expect(like.transactionId).toBe(transactions[0].id);
// });
// it("should get a list of likes for a transaction", () => {
// const user: User = getAllUsers()[0];
// const transactions: Transaction[] = getTransactionsByUserId(user.id);
// const transaction = transactions[0];
// createLike(user.id, transaction.id);
// const likes = getLikesByTransactionId(transaction.id);
// expect(likes[0].transactionId).toBe(transaction.id);
// });
});
Loading

0 comments on commit e796b0b

Please sign in to comment.