bpmn-js/test/spec/i18n/translateSpec.js
Vladimirs Katusenoks 28cc4e8e10 feat(i18n/build): add grunt task for translation extraction
Use `grunt extract-translations` to run extraction.
Will run all test cases to extract the available translations.

Closes #497
2016-05-03 17:31:49 +02:00

59 lines
1.3 KiB
JavaScript

'use strict';
if (window.__env__ && window.__env__.TRANSLATIONS === 'enabled') {
// skipping during translation extraction
return;
}
require('test/TestHelper');
/* global bootstrapModeler, inject */
var coreModule = require('lib/core'),
translateModule = require('diagram-js/lib/i18n/translate'),
customTranslateModule = require('./custom-translate'),
modelingModule = require('lib/features/modeling'),
paletteModule = require('lib/features/palette'),
contextPadModule = require('lib/features/context-pad');
var diagramXML = require('test/fixtures/bpmn/simple.bpmn');
describe('i18n - translate', function() {
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');
}));
});