Skip to content

Commit

Permalink
tests(ControliD, Generic): draw qrcode without image manager
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcust committed May 4, 2023
1 parent 137323b commit c50e002
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions __tests__/profile/ControliD.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ describe('controlid model profile', () => {
);
});

it('draw qrcode from model PrintiD without a image manager', async () => {
const connection = new InMemory();
const printer = await Printer.CONNECT('PrintiD', connection);
await expect(
printer.qrcode('https://github.com/grandchef/escpos-buffer'),
).rejects.toThrow('No image manager to draw qrcode');
});

it('draw qrcode from model PrintiD', async () => {
const connection = new InMemory();
const imageManager = new ImageManager();
Expand Down
8 changes: 8 additions & 0 deletions __tests__/profile/Generic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ describe('generic model profile', () => {
);
});

it('draw qrcode from model CMP-20 without a image manager', async () => {
const connection = new InMemory();
const printer = await Printer.CONNECT('CMP-20', connection);
await expect(
printer.qrcode('https://github.com/grandchef/escpos-buffer'),
).rejects.toThrow('No image manager to draw qrcode');
});

it('draw qrcode from model CMP-20', async () => {
const connection = new InMemory();
const imageManager = new ImageManager();
Expand Down

0 comments on commit c50e002

Please sign in to comment.