Skip to content

Commit f80346f

Browse files
committed
Don't use translate as a method for testing
`.translate` is some magical property in Safari (and Chrome) Safari 7 puts this on the instance, and breaks tests for property effects
1 parent e7254d0 commit f80346f

2 files changed

Lines changed: 10 additions & 14 deletions

File tree

‎test/unit/bind-elements.html‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -595,13 +595,13 @@
595595

596596
<dom-module id="x-bind-computed-property">
597597
<template>
598-
<div id="check">[[translate('Hello World.')]]</div>
598+
<div id="check">[[translateMessage('Hello World.')]]</div>
599599
</template>
600600
<script>
601601
(function(){
602602
var TranslateBehavior = {
603603
properties: {
604-
translate: {
604+
translateMessage: {
605605
type: Function,
606606
computed: '_computeTranslateFn(translator)'
607607
}
@@ -634,7 +634,7 @@
634634

635635
<dom-module id="x-bind-computed-property-late-translator">
636636
<template>
637-
<div id="check">[[translate(message)]]</div>
637+
<div id="check">[[translateMessage(message)]]</div>
638638
</template>
639639
<script>
640640
Polymer({
@@ -644,7 +644,7 @@
644644
type: String,
645645
value: 'Hello'
646646
},
647-
translate: {
647+
translateMessage: {
648648
type: Function,
649649
computed: '_computeTranslateFn(translator)'
650650
},

‎test/unit/bind.html‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,6 @@
296296

297297
var el;
298298

299-
setup(function() {
300-
301-
});
302-
303299
teardown(function() {
304300
document.body.removeChild(el);
305301
});
@@ -334,7 +330,7 @@
334330
Polymer({
335331
is: 'x-observer-with-dynamic-function',
336332
properties: {
337-
translate: {
333+
translateMessage: {
338334
type: Function
339335
},
340336
message: {
@@ -343,15 +339,15 @@
343339
}
344340
},
345341

346-
observers: ['translate(message)']
342+
observers: ['translateMessage(message)']
347343

348344
});
349345

350346
el = document.createElement('x-observer-with-dynamic-function');
351347
document.body.appendChild(el);
352348

353349
var called = 0;
354-
el.translate = function() {
350+
el.translateMessage = function() {
355351
called += 1;
356352
};
357353

@@ -364,9 +360,9 @@
364360
is: 'x-computed-property-with-dynamic-function',
365361
properties: {
366362
computedValue: {
367-
computed: "translate('Hello')"
363+
computed: "translateMessage('Hello')"
368364
},
369-
translate: {
365+
translateMessage: {
370366
type: Function
371367
}
372368
}
@@ -378,7 +374,7 @@
378374
assert.equal(el.computedValue, undefined);
379375

380376
var called = 0;
381-
el.translate = function(message) {
377+
el.translateMessage = function(message) {
382378
called += 1;
383379
return 'translated: ' + message;
384380
};

0 commit comments

Comments
 (0)