Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issue with app-localizer-behavior
- Loading branch information
1 parent
f3d5c89
commit 5c4eefe
Showing
5 changed files
with
94 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<!doctype html> | ||
|
||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>iron-list test</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> | ||
|
||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script> | ||
<script src="../../web-component-tester/browser.js"></script> | ||
|
||
<link rel="import" href="helpers.html"> | ||
<link rel="import" href="../vaadin-grid.html"> | ||
<link rel="import" href="../../app-localize-behavior/app-localize-behavior.html"> | ||
</head> | ||
<body> | ||
|
||
<dom-module id="x-grid"> | ||
<template> | ||
<style> | ||
:host { | ||
display: block; | ||
} | ||
</style> | ||
|
||
<vaadin-grid id="grid" items="[1]"> | ||
<vaadin-grid-column> | ||
<template class="header">[[localize('header')]]</template> | ||
<template>[[item]]</template> | ||
</vaadin-grid-column> | ||
</vaadin-grid> | ||
</template> | ||
<script> | ||
document.addEventListener('WebComponentsReady', function() { | ||
Polymer({ | ||
is: 'x-grid', | ||
|
||
behaviors: [Polymer.AppLocalizeBehavior], | ||
|
||
properties: { | ||
language: { | ||
value: 'en' | ||
} | ||
}, | ||
|
||
attached: function() { | ||
this.loadResources('locales.json'); | ||
} | ||
}); | ||
}); | ||
</script> | ||
</dom-module> | ||
|
||
<test-fixture id="grid"> | ||
<template> | ||
<x-grid></x-grid> | ||
</template> | ||
</test-fixture> | ||
|
||
<script> | ||
|
||
describe('app-localize-behavior', function() { | ||
var container, column, grid; | ||
|
||
beforeEach(function(done) { | ||
container = fixture('grid'); | ||
grid = container.$.grid; | ||
container.addEventListener('app-localize-resources-loaded', function() { | ||
done(); | ||
}); | ||
}); | ||
|
||
it('should localize', function() { | ||
expect(getHeaderCellContent(grid, 0, 0).innerText).to.equal('header'); | ||
}); | ||
|
||
}); | ||
|
||
</script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"en": { | ||
"header": "header" | ||
}, | ||
"fr": { | ||
"header": "le header" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters