
import React from 'react';
import { MPosControllerPrinter } from '../src/MPosControllerPrinter';
import {NativeModules} from "react-native";

test('TEST_setCharacterSet',async()=>{

  const printer = new MPosControllerPrinter();

  return await printer.setCharacterSet(1).then(APIResponse => {
    expect(APIResponse).toBe(1000);
  });
})

test('TEST_setInternationalCharacterSet',async()=>{
  const printer = new MPosControllerPrinter();

  return await printer.setInternationalCharacterSet(1).then(APIResponse => {
    expect(APIResponse).toBe(1000);
  });
})

test('TEST_cutPaper',async()=>{
  const printer = new MPosControllerPrinter();

  return await printer.cutPaper(0).then(APIResponse => {
    expect(APIResponse).toBe(1000);
  });
})

test('TEST_setPageMode',async()=>{
  const printer = new MPosControllerPrinter();

  return await printer.setPageMode(0).then(APIResponse => {
    expect(APIResponse).toBe(1000);
  });
})

test('TEST_setPageModePrintArea',async()=>{
  const printer = new MPosControllerPrinter();

  return await printer.setPageModePrintArea(1,1,1,1).then(APIResponse => {
    expect(APIResponse).toBe(1000);
  });
})

test('TEST_setPageModeDirection',async()=>{
  const printer = new MPosControllerPrinter();

  return await printer.setPageModeDirection(1).then(APIResponse => {
    expect(APIResponse).toBe(1000);
  });
})

test('TEST_setPageModePosition',async()=>{
  const printer = new MPosControllerPrinter();

  return await printer.setPageModePosition(1,1).then(APIResponse => {
    expect(APIResponse).toBe(1000);
  });
})

test('TEST_printText',async()=>{
  const printer = new MPosControllerPrinter();

  return await printer.printText(
      "",1,1,1,
      1,1,1,1)
      .then(APIResponse => {
    expect(APIResponse).toBe(1000);
  });
});

test('TEST_printBitmapFile',async()=>{
  const printer = new MPosControllerPrinter();

  return await printer.printBitmapFile("",1,1,1).then(APIResponse => {
    expect(APIResponse).toBe(1000);
  });
});

test('TEST_printBitmapWithBase64',async()=>{
  const printer = new MPosControllerPrinter();

  return await printer.printBitmapWithBase64("",1,1,).then(APIResponse => {
    expect(APIResponse).toBe(1000);
  });
});

test('TEST_print1DBarcode',async()=>{
  const printer = new MPosControllerPrinter();

  return await printer.print1DBarcode("",1,1,2,1).then(APIResponse => {
    expect(APIResponse).toBe(1000);
  });
});

test('TEST_printQRCode',async()=>{
  const printer = new MPosControllerPrinter();

  return await printer.printQRCode("",1,1,2,1).then(APIResponse => {
    expect(APIResponse).toBe(1000);
  });
});

test('TEST_printPDF417',async()=>{
  const printer = new MPosControllerPrinter();

  return await printer.printPDF417("",1,1,2,3,1,2,1).then(APIResponse => {
    expect(APIResponse).toBe(1000);
  });
});

test('TEST_printDataMatrix',async()=>{
  const printer = new MPosControllerPrinter();

  return await printer.printDataMatrix("",1,2).then(APIResponse => {
    expect(APIResponse).toBe(1000);
  });
});

test('TEST_checkPrinterStatus',async()=>{
  const printer = new MPosControllerPrinter();

  return await printer.checkPrinterStatus().then(APIResponse => {
    expect(APIResponse).toBe(-1);
  });
});

test('TEST_asbEnable',async()=>{
  const printer = new MPosControllerPrinter();

  return await printer.asbEnable(false).then(APIResponse => {
    expect(APIResponse).toBe(1000);
  });
});

test('TEST_openDrawer',async()=>{
  const printer = new MPosControllerPrinter();

  return await printer.openDrawer(1,1,1).then(APIResponse => {
    expect(APIResponse).toBe(1000);
  });
});

test('TEST_getModelName',async()=>{
  const printer = new MPosControllerPrinter();
  const result = await printer.getModelName();

   expect(result).toBe("");

});

test('TEST_getFirmwareVersion',async()=>{
  const printer = new MPosControllerPrinter();

  return await printer.getFirmwareVersion().then(APIResponse => {
    expect(APIResponse).toBe("");
  });
});

test('TEST_getStatisticsData',async()=>{
  const printer = new MPosControllerPrinter();

  return await printer.getStatisticsData(0).then(APIResponse => {
    expect(APIResponse).toBe("");
  });
});
