Skip to content

Commit

Permalink
Fixes getodk#1047: call setFilename instead of triggering click
Browse files Browse the repository at this point in the history
  • Loading branch information
sadiqkhoja committed Dec 31, 2024
1 parent b8c40da commit 4f18ade
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test/components/entity/upload/data-template.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,16 @@ describe('EntityUploadDataTemplate', () => {
it('has the correct filename', async () => {
const clock = sinon.useFakeTimers(Date.parse('2024-12-31T01:23:45'));
testData.extendedDatasets.createPast(1);
const a = mountComponent().get('a');
await a.trigger('click');
const component = mountComponent();
const a = component.get('a');
// Call setFilename method directly instead of trigger click event which
// creates the actual file in the file system; see CF#1047.
// Additionally, since Chrome Headless 131.0.0.0, this test has started
// failing
component.vm.setFilename({ target: a.element });
a.attributes().download.should.equal('trees 20241231012345.csv');
clock.tick(1000);
await a.trigger('click');
component.vm.setFilename({ target: a.element });
a.attributes().download.should.equal('trees 20241231012346.csv');
});
});

0 comments on commit 4f18ade

Please sign in to comment.