diff --git a/Testfunctions - Copy/loader.test.js b/Testfunctions - Copy/loader.test.js new file mode 100644 index 000000000..5a9ca61d1 --- /dev/null +++ b/Testfunctions - Copy/loader.test.js @@ -0,0 +1,19 @@ + +const {JSDOM} = require('jsdom') + +//test for successful upload +test("Successful upload", () => { + const handleUpload = jest.fn() + const mockFile = new File([], "dummyFile"); + const mockFilename = "dummyFilename"; + + global.changeStatus = jest.fn(); + + return handleUpload(mockFile, mockFilename) + + expect(global.changeStatus).toHaveBeenCalledWith("UPLOAD", "dummyFile uploaded successfully"); + +}); + +//test for the upload function + diff --git a/Testfunctions - Copy/toolbar.test.js b/Testfunctions - Copy/toolbar.test.js new file mode 100644 index 000000000..3bce33b5b --- /dev/null +++ b/Testfunctions - Copy/toolbar.test.js @@ -0,0 +1,41 @@ + +const {JSDOM} = require('jsdom') + +//test for the selected function +describe ('selected function', ()=>{ + test('should add checked class to all elements until reaching an element with class "multidown"',()=>{ + const selected = jest.fn() + + const dom = new JSDOM('