Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: camunda 8 extension issue .bpmn #4663

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion client/src/app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -1438,6 +1438,7 @@ export class App extends PureComponent {
} = options;

const provider = tabsProvider.getProvider(fileType);
const saveType = provider.extensions[0];

let savePath;

Expand All @@ -1464,7 +1465,7 @@ export class App extends PureComponent {
encoding,
originalFile: file,
savePath,
saveType: fileType
saveType
};

}
Expand Down
28 changes: 28 additions & 0 deletions client/src/app/__tests__/AppSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,34 @@ describe('<App>', function() {
});


it('should save tab with correct extension', async function() {

// given
const file = createFile('diagram_1.bpmn', { type: 'cloud-bpmn' });

await app.openFiles([ file ]);

dialog.setShowSaveFileDialogResponse('diagram_2');

// when
await app.triggerAction('save-as');

// then
expect(showSaveFileDialogSpy).to.have.been.called;

expect(writeFileSpy).to.have.been.calledWith(
'diagram_2',
{
...file,
contents: 'CONTENTS'
},
{
encoding: 'utf8',
fileType: 'bpmn'
}
);
});

it('should save as existing tab', async function() {

// given
Expand Down
Loading