Skip to content

Commit

Permalink
Finished Testing
Browse files Browse the repository at this point in the history
Deleted getProductsWithLookupKey method as products don't have lookup key values. Removed lookup key and metadata tests as they aren't necessary.
  • Loading branch information
asun555 committed Mar 31, 2024
1 parent e61b560 commit 18af86e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
15 changes: 0 additions & 15 deletions server/src/business-layer/services/StripeService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,8 @@ describe("Stripe service functionality", () => {
expect(result.length).toEqual(4)
})

// should be using mock id? what's the point of testing again for the thing specified above
it("should get a product by id", async () => {
const result = await new StripeService().getProductById("random_id")
expect(result).toEqual({ ...productMock, id: "random_id" })
})

// productMock doesn't have lookup key?
// it("should get a product with lookup key", async () => {
// const result = await new StripeService().getProductsWithLookupKey(
// "prod_NWjs8kKbJWmuuc"
// )
// expect(result).toEqual(productMock)
// })

// productMock doesn't have metadata?
// it("should get a product by metadata", async () => {
// const result = await new StripeService().getProductByMetadata("", "")
// expect(result).toEqual(productMock)
// })
})
7 changes: 0 additions & 7 deletions server/src/business-layer/services/StripeService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ import Stripe from "stripe"
const stripe = new Stripe(process.env.STRIPE_API_KEY)

export default class StripeService {
public async getProductsWithLookupKey(lookupKey: string) {
const result = await stripe.products.search({
query: `lookup_key:'${lookupKey}'`
})
return result.data
}

public async getAllProducts(limit?: number, startingAfter?: string) {
const products = await stripe.products.list({
limit,
Expand Down

0 comments on commit 18af86e

Please sign in to comment.