import 'dart:typed_data';

import 'package:docx/docx.dart';
import 'package:test/test.dart';

import 'dart:io';

// Test only on desktop
void main() {
  test('Try to generate a file without error', () {

  Uint8List catImg = File('test/assets/cat.png').readAsBytesSync();
  Uint8List dogImg = File('test/assets/dog.jpg').readAsBytesSync();

  DocxEditor(
    fileInDocx: File('test/assets/docx_test_copy.docx'),
    pathOutDocx: 'test/assets/docx_test.docx', 
    replaceMap: {
      'Title': ReplaceContent(value: 'NewTitle'),
      'A': ReplaceContent(value: 'AModified'),
      'Image-Dog': ReplaceContent(value: 'NotImage-Dog'),
      'ImageCat': ReplaceContent(img: DocxImage(bytes: catImg, name: 'cat.png' , sizeX: 200, sizeY: 400)),
      'Image-Cat': ReplaceContent(img: DocxImage(bytes: catImg, name: 'cat.png' , sizeX: 200, sizeY: 400)),
      'Footer': ReplaceContent(img: DocxImage(bytes: dogImg, name: 'dog.jpg', sizeX: 400, sizeY: 300))
    }
  );
  });
}
