Permalink
Browse files

fix javascript tests (Firefox 20, Safari 6, Chrome 25)

  • Loading branch information...
1 parent 55b52ef commit 8dc5433e4b9056ad8f6047af73b8db65155ca507 @robocoder robocoder committed Mar 24, 2013
Showing with 7 additions and 6 deletions.
  1. +2 −2 js/piwik.js
  2. +5 −4 tests/javascript/index.php
View
@@ -955,9 +955,9 @@ if (typeof Piwik !== 'object') {
* Title fixup
*/
function titleFixup(title) {
- if (!isString(title)) {
- title = title.text || '';
+ title = title && title.text ? title.text : title;
+ if (!isString(title)) {
var tmp = documentAlias.getElementsByTagName('title');
if (tmp && isDefined(tmp[0])) {
@@ -1114,7 +1114,8 @@ function wait(msecs)
|| /(EcommerceView).*(&cvar=%7B%223%22%3A%5B%22_pks%22%2C%22SKU%22%5D%2C%224%22%3A%5B%22_pkn%22%2C%22NAME%20HERE%22%5D%2C%225%22%3A%5B%22_pkc%22%2C%22CATEGORY%20HERE%22%5D%7D)/.test(results), "ecommerce view");
// ecommerce view multiple categories
- ok( /(MultipleCategories).*(&cvar=%7B%222%22%3A%5B%22cookiename2PAGE%22%2C%22cookievalue2PAGE%22%5D%2C%225%22%3A%5B%22_pkc%22%2C%22%5B%5C%22CATEGORY1%5C%22%2C%5C%22CATEGORY2%5C%22%5D%22%5D%2C%223%22%3A%5B%22_pks%22%2C%22SKUMultiple%22%5D%2C%224%22%3A%5B%22_pkn%22%2C%22%22%5D%7D)/.test(results), "ecommerce view multiple categories");
+ ok( /(MultipleCategories).*(&cvar=%7B%222%22%3A%5B%22cookiename2PAGE%22%2C%22cookievalue2PAGE%22%5D%2C%225%22%3A%5B%22_pkc%22%2C%22%5B%5C%22CATEGORY1%5C%22%2C%5C%22CATEGORY2%5C%22%5D%22%5D%2C%223%22%3A%5B%22_pks%22%2C%22SKUMultiple%22%5D%2C%224%22%3A%5B%22_pkn%22%2C%22%22%5D%7D)/.test(results)
+ || /(MultipleCategories).*(&cvar=%7B%222%22%3A%5B%22cookiename2PAGE%22%2C%22cookievalue2PAGE%22%5D%2C%223%22%3A%5B%22_pks%22%2C%22SKUMultiple%22%5D%2C%224%22%3A%5B%22_pkn%22%2C%22%22%5D%2C%225%22%3A%5B%22_pkc%22%2C%22%5B%5C%22CATEGORY1%5C%22%2C%5C%22CATEGORY2%5C%22%5D%22%5D%7D)/.test(results), "ecommerce view multiple categories");
// Ecommerce order
ok( /idgoal=0&ec_id=ORDER%20ID%20YES&revenue=666.66&ec_st=333&ec_tx=222&ec_sh=111&ec_dt=1&ec_items=%5B%5B%22SKU%20PRODUCT%22%2C%22random%22%2C%22random%20PRODUCT%20CATEGORY%22%2C11.1111%2C2%5D%2C%5B%22SKU%20ONLY%20SKU%22%2C%22%22%2C%22%22%2C0%2C1%5D%2C%5B%22SKU%20ONLY%20NAME%22%2C%22PRODUCT%20NAME%202%22%2C%22%22%2C0%2C1%5D%2C%5B%22SKU%20NO%20PRICE%20NO%20QUANTITY%22%2C%22PRODUCT%20NAME%203%22%2C%22CATEGORY%22%2C0%2C1%5D%2C%5B%22SKU%20ONLY%22%2C%22%22%2C%22%22%2C0%2C1%5D%5D/.test( results ), "logEcommerceOrder() with items" );
@@ -1133,11 +1134,11 @@ function wait(msecs)
ok( /testlink/.test( results ), "plugin hook link" );
ok( /testgoal/.test( results ), "plugin hook goal" );
- // Testing the Tracking URL append
- ok( /&appended=1&appended2=value/.test( results ), "appendToTrackingUrl(query) function");
+ // Testing the Tracking URL append
+ ok( /&appended=1&appended2=value/.test( results ), "appendToTrackingUrl(query) function");
start();
- }, 4500);
+ }, 5000);
});
';
}

0 comments on commit 8dc5433

Please sign in to comment.