Skip to content

Commit

Permalink
FIX: test stacks
Browse files Browse the repository at this point in the history
  • Loading branch information
augustovicente committed Apr 10, 2024
1 parent fd6e99a commit 7a8c572
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions tests/unit/stack.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const new_draft: CreateNewDraftRequest = {

let slug: string, stack_id: string;

describe('Create a normal publication', () => {
describe('Stack and Draft', () => {
it('token should be defined', () => {
expect(issuu_token).toBeDefined();
});
Expand Down Expand Up @@ -57,14 +57,13 @@ describe('Create a normal publication', () => {

try {
await draft.publishDraftBySlug(slug);
await new Promise((r) => setTimeout(r, 2000));
} catch (error: any) {
console.error('Error publishing draft:', error.response.data);
throw error;
}
});
});

describe('Create new stack', () => {
it('should create a new stack', async () => {
try {
const new_stack: CreateNewStackRequest = {
Expand All @@ -80,9 +79,7 @@ describe('Create new stack', () => {
throw error;
}
});
});

describe('Get stack by id', () => {
it('should get the stack by id', async () => {
try {
const found_stack = await stack.getStack(stack_id);
Expand All @@ -95,9 +92,7 @@ describe('Get stack by id', () => {
throw error;
}
});
});

describe('Update stack', () => {
it('should update the stack', async () => {
try {
const updated_stack = await stack.updateStack(stack_id, {
Expand All @@ -120,9 +115,7 @@ describe('Update stack', () => {
throw error;
}
});
});

describe('Add, Get and Remove stack item', () => {
it('should add, get and remove a stack item', async () => {
try {
await stack.addStackItem(stack_id, slug);
Expand Down Expand Up @@ -151,9 +144,7 @@ describe('Add, Get and Remove stack item', () => {
throw error;
}
});
});

describe('Delete stack', () => {
it('should delete the stack', async () => {
try {
await stack.deleteStack(stack_id);
Expand All @@ -162,9 +153,7 @@ describe('Delete stack', () => {
throw error;
}
});
});

describe('Delete publication', () => {
it('should delete the publication', async () => {
try {
await publication.deletePublicationBySlug(slug);
Expand Down

0 comments on commit 7a8c572

Please sign in to comment.