Skip to content

Commit

Permalink
clean and remake test
Browse files Browse the repository at this point in the history
  • Loading branch information
GoodDayForSurf committed Dec 27, 2024
1 parent 9397481 commit 2afb22c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion apps/demos/Demos/Charts/ExportCustomMarkup/jQuery/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ $(() => {
format: 'png',
svgToCanvas(svg, canvas) {
const deferred = $.Deferred();
console.log('---------->', canvas.getContext('2d'));

canvas.getContext('2d')
.drawSvg(new XMLSerializer().serializeToString(svg), 0, 0, null, null, {
renderCallback: deferred.resolve,
Expand Down
16 changes: 8 additions & 8 deletions apps/demos/testing/widgets/charts/Export.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ fixture('Charts.Export')

runManualTest('Charts', 'ExportCustomMarkup', ['jQuery', 'React', 'Vue', 'Angular'], (test) => {
test('Export', async (t) => {
let dialogAppeared = false;
let checkData = {downloadFileType: null};

await ClientFunction(() => {
window.originalShowSaveFilePicker = window.showSaveFilePicker;
await ClientFunction((checkData) => {
window.originalCreateObjectURL = URL.createObjectURL;

window.showSaveFilePicker = () => {
dialogAppeared = true;
URL.createObjectURL = (blob) => {
checkData.downloadFileType = blob.type;
return Promise.reject();
};
})();
})(checkData);

await t.click('#export,.dx-button[icon=export]').wait(2000);

await t.expect(dialogAppeared).ok('Save dialog should appear');
await t.expect(checkData.downloadFileType).eql('image/png').ok('Save dialog should appear');

await ClientFunction(() => {
window.showSaveFilePicker = window.originalShowSaveFilePicker;
URL.createObjectURL = window.originalCreateObjectURL;
})();

});
Expand Down

0 comments on commit 2afb22c

Please sign in to comment.