Skip to content

Commit

Permalink
[DE-746] Fix proforma tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maciej-nedza committed Mar 5, 2024
1 parent 40be0d4 commit 0013eef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('Proforma Invoices Controller', () => {

const listResponse =
await proformaInvoicesController.listSubscriptionGroupProformaInvoices(
uid
{uid: uid}
);

const [proformaInvoice] = listResponse.result.proformaInvoices || [];
Expand All @@ -72,7 +72,7 @@ describe('Proforma Invoices Controller', () => {
test('should throw 404 when listSubscriptionGroupProformaInvoices with an invalid uid', async () => {
const promise =
proformaInvoicesController.listSubscriptionGroupProformaInvoices(
'invalid'
{uid: 'invalid'}
);
expect(promise).rejects.toThrow();
await promise.catch((reason) => {
Expand All @@ -83,7 +83,7 @@ describe('Proforma Invoices Controller', () => {
test('should throw 404 when listSubscriptionGroupProformaInvoices with an invalid client', async () => {
const promise =
invalidProformaInvoicesController.listSubscriptionGroupProformaInvoices(
'invalid'
{uid: 'invalid'}
);
expect(promise).rejects.toThrow();
await promise.catch((reason) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ProformaInvoicesController } from 'advanced-billing-sdk';
import { ProformaInvoicesController, CreateSignupProformaPreviewInclude } from 'advanced-billing-sdk';
import { createClient, createInvalidClient } from '../config';
import { uid } from 'uid';
import createProduct from '../utils/products';
Expand Down Expand Up @@ -54,7 +54,7 @@ describe('Create a Preview Sign Up Proforma Invoice', () => {

const response =
await proformaInvoicesController.previewSignupProformaInvoice(
'nextProformaId',
CreateSignupProformaPreviewInclude.NextProformaInvoice,
{
subscription: {
productHandle,
Expand All @@ -81,7 +81,7 @@ describe('Create a Preview Sign Up Proforma Invoice', () => {

test('should throw an error when user sends an invalid payload with a missing product', async () => {
const promise = proformaInvoicesController.previewSignupProformaInvoice(
'',
undefined,
{
subscription: {
customerReference: uid(),
Expand All @@ -102,7 +102,7 @@ describe('Create a Preview Sign Up Proforma Invoice', () => {
productHandle,
});
const promise = proformaInvoicesController.previewSignupProformaInvoice(
'',
undefined,
{
subscription: {
productHandle,
Expand All @@ -122,7 +122,7 @@ describe('Create a Preview Sign Up Proforma Invoice', () => {

test('should throw an 401 error with invalid credentials', async () => {
const promise =
invalidProformaInvoicesController.previewSignupProformaInvoice('', {
invalidProformaInvoicesController.previewSignupProformaInvoice(undefined, {
subscription: {},
});

Expand Down

0 comments on commit 0013eef

Please sign in to comment.