Currently I'm doing a couple of POC's related with Office Addin testing and can't find documentation about how to test it.
The library documentation has only a couple of example with trivial functionalities but it's a little bit more complex and I can't reach yet.
The test case should be:
A function addWs that add a worksheet in a workbook. Currently I got it.
A Mock with an specific number of worksheets. (Here is that a I want) This is the current Mock that I have:
const ExcelMockData = { context: { workbook: { load: (propertyNames?: string | string[]) => {}, range: { address: 'G4', format: { fill: {}, }, }, protection: { protected: true, }, worksheets: { items: [{}, {}], }, getSelectedRange: function () { return this.range; }, }, },
run: async function (callback: any) { await callback(this.context); }, };
A test that proves that the number of worksheets increase after call my function addWs