Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions src/utils/tests/BlueBaseModule.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,17 @@ describe('Utils', () => {
expect(obj.foo).toBe('bar');
});

// it('should set loaded prop of only the loaded item', async () => {

// // FIXME: Big bug!!!
// const module = createBlueBaseModule({ foo: 'bar' });
// const module1 = createBlueBaseModule({ foo: 'baz' });
// expect(module.loaded).toBe(false);
// expect(module1.loaded).toBe(false);

// const obj = await module;
it('should set loaded prop of only the loaded item', () => {
const module = createBlueBaseModule({ foo: 'bar' });
const module1 = createBlueBaseModule({ foo: 'baz' });
expect(module.loaded).toBe(false);
expect(module1.loaded).toBe(false);

// expect(obj.foo).toBe('bar');
// expect(module.loaded).toBe(true);
// expect(module1.loaded).toBe(false);
// });
module.then(obj => {
expect(obj.foo).toBe('bar');
expect(module.loaded).toBe(true);
});
expect(module1.loaded).toBe(false);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if you move this test inside the then callback? @omarnaeem0

@omarnaeem0 omarnaeem0 Dec 26, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@artalat sir are you referring to the line 69?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

});
});
});