Blame view

bower_components/select2/tests/options/translation-tests.js 633 Bytes
f6e211e4   Administrator   finish work part 1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  module('Options - Translations');
  
  var $ = require('jquery');
  var Options = require('select2/options');
  
  test('partial dictionaries can be passed', function (assert) {
    var options = new Options({
      language: {
        searching: function () {
          return 'Something';
        }
      }
    });
  
    var translations = options.get('translations');
  
    assert.equal(
      translations.get('searching')(),
      'Something',
      'The partial dictionary still overrides translations'
    );
  
    assert.equal(
      translations.get('noResults')(),
      'No results found',
      'You can still get English translations for keys not passed in'
    );
  });