Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
add downloadContent helper #43
I created a helper function for downloading a file, a csv file or text. This works even with utf-8 and opening it directly in Excel - a very common need in SharePoint development. An example is an "Export to Excel" button in Search based applications. Some more info can be found on my blog post:
From what I can see, the CI build worked fine.
Would it be possible to test this in some way? I'm thinking we could at least stub the browser functionality, and check that the function does validation as expected. E.g. test that
Also, I think we should use a more generic default file name (instead of "tolle.txt" =)
This is quite the difficult function to unit test, since it is heavily dependent on browser functionality and user interaction (like checking the downloaded file). Maybe we cannot test more than this, automatically. I think, regarding testing, the test you supplied is sufficient.
I've one more comment, though. the
To keep the style consistent, we should put the