Skip to content

Commit

Permalink
Merge pull request #55 from PolymerElements/fix-event-names-in-test
Browse files Browse the repository at this point in the history
update event names in tests
  • Loading branch information
notwaldorf committed Sep 15, 2016
2 parents 1aa76a2 + a81f77c commit 7d3a0d5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/basic.html
Expand Up @@ -168,7 +168,7 @@
// Keep the tests independent by resetting the internal cache.
resetRequestsCache(app);

app.addEventListener('app-resources-loaded', function() {
app.addEventListener('app-localize-resources-loaded', function() {
assert.equal(app.language, 'en');
assert.equal(app.$.output.innerHTML, 'hello');

Expand All @@ -188,7 +188,7 @@
// Keep the tests independent by resetting the internal cache.
resetRequestsCache(app);

app.addEventListener('app-resources-loaded', function() {
app.addEventListener('app-localize-resources-loaded', function() {
assert.equal(app.language, 'en');
assert.equal(app.$.output.innerHTML, 'my name is batman. i have 3 cats.');

Expand All @@ -210,7 +210,7 @@
resetRequestsCache(app1);
resetRequestsCache(app2);

app1.addEventListener('app-resources-loaded', function() {
app1.addEventListener('app-localize-resources-loaded', function() {
assert.equal(app1.language, 'en');
assert.equal(app2.language, 'en');
assert.equal(app1.localize('greeting'), 'hello');
Expand Down Expand Up @@ -250,7 +250,7 @@
assert.equal(0, Object.keys(getRequestsCache(app3)).length);

// Once the first file has been loaded, it should be the only thing in the cache.
app1.addEventListener('app-resources-loaded', function() {
app1.addEventListener('app-localize-resources-loaded', function() {
assert.equal(1, Object.keys(getRequestsCache(app1)).length, 'there is 1 request cached in app1');
assert.equal(1, Object.keys(getRequestsCache(app2)).length, 'there is 1 request cached in app2');
assert.equal(1, Object.keys(getRequestsCache(app3)).length, 'there is 1 request cached in app3');
Expand All @@ -260,7 +260,7 @@
assert.equal(app1.resources['fr']['greeting'], 'bonjour');

// Loading the second file should not make an iron-ajax request, and re-use the one in the cache.
app2.addEventListener('app-resources-loaded', function() {
app2.addEventListener('app-localize-resources-loaded', function() {
assert.equal(1, Object.keys(getRequestsCache(app1)).length, 'there is 1 request cached in app1');
assert.equal(1, Object.keys(getRequestsCache(app2)).length, 'there is 1 request cached in app2');
assert.equal(1, Object.keys(getRequestsCache(app3)).length, 'there is 1 request cached in app3');
Expand All @@ -270,7 +270,7 @@
assert.equal(app2.resources['fr']['greeting'], 'bonjour');

// Loading the third file should not make an iron-ajax request, and re-use the one in the cache.
app3.addEventListener('app-resources-loaded', function() {
app3.addEventListener('app-localize-resources-loaded', function() {
assert.equal(1, Object.keys(getRequestsCache(app1)).length, 'there is 1 request cached in app1');
assert.equal(1, Object.keys(getRequestsCache(app2)).length, 'there is 1 request cached in app2');
assert.equal(1, Object.keys(getRequestsCache(app3)).length, 'there is 1 request cached in app3');
Expand Down Expand Up @@ -305,7 +305,7 @@
var path2 = app1.resolveUrl('locales2.json');

// Once the first file has been loaded, it should be the only thing in the cache.
app1.addEventListener('app-resources-loaded', function() {
app1.addEventListener('app-localize-resources-loaded', function() {
assert.equal(1, Object.keys(getRequestsCache(app1)).length, 'there is 1 request cached in app1');
assert.equal(1, Object.keys(getRequestsCache(app2)).length, 'there is 1 request cached in app2');

Expand All @@ -314,7 +314,7 @@
assert.equal(app1.resources['fr']['greeting'], 'bonjour');

// Loading a different file should make a different ajax request.
app2.addEventListener('app-resources-loaded', function() {
app2.addEventListener('app-localize-resources-loaded', function() {
assert.equal(2, Object.keys(getRequestsCache(app1)).length, 'there are 2 requests cached in app1');
assert.equal(2, Object.keys(getRequestsCache(app2)).length, 'there are 2 requests cached in app2');

Expand Down

0 comments on commit 7d3a0d5

Please sign in to comment.