2018-04-02 19:01:53 +00:00
|
|
|
import {
|
|
|
|
bootstrapModeler,
|
2020-12-21 08:50:49 +00:00
|
|
|
collectTranslations,
|
2018-04-02 19:01:53 +00:00
|
|
|
inject
|
|
|
|
} from 'test/TestHelper';
|
|
|
|
|
|
|
|
import coreModule from 'lib/core';
|
|
|
|
import translateModule from 'diagram-js/lib/i18n/translate';
|
|
|
|
import customTranslateModule from './custom-translate';
|
|
|
|
import modelingModule from 'lib/features/modeling';
|
|
|
|
import paletteModule from 'lib/features/palette';
|
|
|
|
import contextPadModule from 'lib/features/context-pad';
|
2016-02-25 16:40:56 +00:00
|
|
|
|
|
|
|
var diagramXML = require('test/fixtures/bpmn/simple.bpmn');
|
|
|
|
|
|
|
|
|
2020-12-21 08:50:49 +00:00
|
|
|
// skipping this file during translation extraction
|
2016-02-25 16:40:56 +00:00
|
|
|
|
2020-12-21 08:50:49 +00:00
|
|
|
collectTranslations ? describe.skip : describe('i18n - translate', function() {
|
2016-05-03 14:23:31 +00:00
|
|
|
|
2016-02-25 16:40:56 +00:00
|
|
|
beforeEach(bootstrapModeler(diagramXML, {
|
|
|
|
modules: [
|
|
|
|
coreModule,
|
|
|
|
modelingModule,
|
|
|
|
paletteModule,
|
|
|
|
contextPadModule,
|
|
|
|
translateModule,
|
|
|
|
customTranslateModule
|
|
|
|
]
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
it('should translate palette', inject(function(palette) {
|
|
|
|
|
|
|
|
// when
|
|
|
|
var handToolEntry = palette.getEntries()['hand-tool'];
|
|
|
|
|
|
|
|
// then
|
|
|
|
expect(handToolEntry.title).to.equal('Activar herramienta mano');
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
it('should translate context pad', inject(function(contextPad) {
|
|
|
|
|
|
|
|
// given
|
|
|
|
contextPad.open('Task_1');
|
|
|
|
|
|
|
|
// when
|
|
|
|
var deleteEntry = contextPad._current.entries.delete;
|
|
|
|
|
|
|
|
// then
|
|
|
|
expect(deleteEntry.title).to.equal('Eliminar');
|
|
|
|
}));
|
|
|
|
|
|
|
|
});
|