Closed michayou closed 12 months ago
Actually . . . you wrote the getSelectedRange method in the MockData object you created. The mock was not built to have all the methods and functionality that office.js has, it was created as an interface that allows you to return whatever you want in order to test your add-in code without having to run excel (and office.js doesn't work outside of an actual office application). The idea is not to test Excels capabilities, but the add-ins.
If you want to test a full interaction with Excel, then you need the full office,js running in an Excel host.
Look, I'm not 100% sure that this is a bug, or a lack of guidance, but when I try to use a member function from a mocked range, worksheet, or name it isn't there. If there is a way to make them happen, please let me know.
Current behavior
If I use the mock to get a range, the range does not contain, for example, getAbsoluteResizedRange. Names do not contain add, worksheets, does not contain
getActiveWorksheet
orgetRange
Expected behavior
When I create a mock, I should have access to these functions.
Steps to Reproduce
I mean, I can write my own versions of those functions, as you have for
getSelectedRange
but that defeats the purpose of trying to use Excel's capabilities.