|
!function(e){function t(o){if(s[o])return s[o].exports;var r=s[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var s={};return t.m=e,t.c=s,t.p="",t(0)}([function(e,t,s){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}var r=s(17),n=o(r);window.$$specRunner=(0,n["default"])("chrome")},,,,,,,,,,,,,,,,,function(e,t,s){"use strict";function o(e){function t(){for(var e=arguments.length,t=Array(e),s=0;e>s;s++)t[s]=arguments[s];var o=t.map(function(e){var t=r[e]["default"]().map(function(e){return"function"!=typeof e?function(t){return t(e)}:e});return{specs:t,key:e}});o.forEach(n)}var s=function(e){try{console.group("%c"+e.key+" spec","font-weight:900;font-size:1.4em"),e.specs.forEach(function(e){return e(function(e){console.log("%c"+e.msg,"color:grey;font-weight:900"),console.log("%c"+(e.res===!0?"[PASS]":"[FAIL]")+" actual: "+e.actual,"color:"+(e.res===!0?"blue":"red"))})}),console.groupEnd()}catch(t){console.warn(t)}},o=function(e){console.log(e.key+" spec"),e.specs.forEach(function(e){return e(function(e){console.log(""+e.msg),console.log((e.res===!0?"[PASS]":"[FAIL]")+" actual: "+e.actual)})})},n="chrome"===e?s:o;return t.help=function(){var e=Object.keys(r).filter(function(e){return"get"!==e.slice(0,3)});console.log("This is a list of of available tests to run\n "+JSON.stringify(e)+"\n you can input any one into window.$$specRunner(<key>) to run the specs")},t}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o;var r=s(18)},function(e,t,s){"use strict";e.exports={basketItems:s(19),emb:s(20),scd:s(21),config:s(22),osr:s(23),referrers:s(24)}},function(e,t){"use strict";function s(){var e=function(e){return window.__scd.b.i.reduce(function(t,s){return s.hasOwnProperty(e)&&t.push({property:e,val:s[e]}),t},[])},t=e("i"),s=e("v"),o=e("q"),r=e("u"),n=e("n"),c=e("f1");return[{actual:JSON.stringify(t),res:t.length===__scd.b.i.length,msg:"basket items must have i property"},{actual:JSON.stringify(s),res:s.length===__scd.b.i.length,msg:"basket items must have v property"},{actual:JSON.stringify(o),res:o.length===__scd.b.i.length,msg:"basket items must have q property"},{actual:JSON.stringify(r),res:r.length===__scd.b.i.length,msg:"basket items must have u property"},{actual:JSON.stringify(n),res:n.length===__scd.b.i.length,msg:"basket items must have n property"},{actual:JSON.stringify(c),res:c.length===__scd.b.i.length,msg:"basket items must have f1 property"}]}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=s},function(e,t){"use strict";function s(){return[{actual:JSON.stringify(__scd.b.i),res:__scd.b.i.length>0,msg:"basket should have items in it"},{actual:JSON.stringify(__scd.b.i.map(function(e){return Object.keys(e)})),res:__scd.b.i.filter(function(e){return e.hasOwnProperty("i")&&e.hasOwnProperty("u")&&e.hasOwnProperty("n")&&e.hasOwnProperty("q")&&e.hasOwnProperty("v")}).length===__scd.b.i.length,msg:"basket items should have i, u, n, q, v properties"},{actual:__scd.b.v,res:["string"===o(__scd.b.v),/^[0-9\.]+$/.test(__scd.b.v)],msg:"__scd.b.v should be a string or a number and it should not have a currency symbol"},{actual:JSON.stringify({c:__scd.b.c,v:__scd.b.v}),res:["string"==typeof __scd.b.c,"string"==typeof __scd.b.v],msg:"__scd.b should have currency and value and both should be strings"},{actual:JSON.stringify(__scd.b.i.map(function(e){return e.v})),res:__scd.b.i.filter(function(e){return/^[0-9\.]+$/.test(e.v)}).length===__scd.b.i.length,msg:"all v property (value) in basket items should not have currency symbol"},{actual:JSON.stringify(__scd.c),res:__scd.c.hasOwnProperty("e"),msg:"__scd.c should have email property"},{actual:__scd.c.e,res:"string"==typeof __scd.c.e&&!/^\s+$/.test(__scd.c.e)&&null!==__scd.c.e,msg:"__scd.c.e should be a string and cannot be empty or null"},{actual:JSON.stringify(__scd.g),res:0===__scd.g.length,msg:"errors array should be empty"},{actual:__sco.osr.scrapeEmailAddress(),res:__sco.osr.scrapeEmailAddress()!==!1,msg:"osr.scrapeEmailAddress cannot return false"},{actual:__scd.t,res:(100===__scd.t||200===__scd.t||499===__scd.t)&&"number"==typeof __scd.t,msg:"basket status should be 100, 200 or 499 and must be a number"},{actual:__sco.osr.getTemplateKeyword(),res:"string"==typeof __sco.osr.getTemplateKeyword()&&null!==__sco.osr.getTemplateKeyword(),msg:"instance keyword should exist and must be a string"},{actual:__sco.osr.activeInstanceConfig.showEmailCapture,res:__sco.osr.activeInstanceConfig.showEmailCapture===!0,msg:"__sco.osr.activeInstanceConfig.showEmailCapture should be true"},{actual:__sco.osr.canShowEmailCapture(),res:__sco.osr.canShowEmailCapture()===!0,msg:"__sco.osr.canShowEmailCapture() should be true"},{actual:_scs(__sco.osr.activePageConfig.selectors.saveButton+":first").outerHTML,res:_scs(__sco.osr.activePageConfig.selectors.saveButton).length>=1,msg:"_scs(__sco.osr.activePageConfig.selectors.saveButton) should exist"},{actual:__sco.osr.errorState,res:__sco.osr.errorState!==!0,msg:"osr errorstate should not be true"},{actual:JSON.stringify(__sco.osr.requestHeaders),res:[2===__sco.osr.requestHeaders.length,"Content-Type"===__sco.osr.requestHeaders[0].key&&"application/json"===__sco.osr.requestHeaders[0].value,"Accept"===__sco.osr.requestHeaders[1].key&&"application/json"===__sco.osr.requestHeaders[1].value],msg:"request headers length should be 2 and should accept content type application/json"}]}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};t["default"]=s},function(e,t){"use strict";function s(){return[{actual:__scd,res:"object"===("undefined"==typeof __scd?"undefined":o(__scd))&&void 0!==__scd.b,msg:"__scd object should be defined"},{actual:__scd.b,res:"object"===o(__scd.b)&&void 0!==__scd.b.i,msg:"__scd object should have b and i properties"},{actual:__scd.s,res:"object"===o(__scd.s),msg:'__scd should have session "s" object'},{actual:__scd.c.e,res:"string"==typeof __scd.c.e,msg:'email field should be populated in c "customer" object on __scd'}]}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};t["default"]=s},function(e,t){"use strict";function s(){return[{actual:__sco.config.doc.i,res:4===__sco.config.doc.i.toString().length,msg:"__sco.config.doc.i.length should be 4"},{actual:__sco.config.doc.i1,res:5===__sco.config.doc.i1.toString().length,msg:"__sco.config.doc.i1.length should be 5"},{actual:o(__sco.config.doc.i),res:"number"==typeof __sco.config.doc.i,msg:"doc i should be a number"},{actual:o(__sco.config.doc.i1),res:"number"==typeof __sco.config.doc.i1,msg:"doc i1 should be a number"},{actual:__sco.config.timestamptemplate.i,res:4===__sco.config.timestamptemplate.i.toString().length,msg:"timestamptemplate.i length should be 4"},{actual:__sco.config.timestamptemplate.i1,res:5===__sco.config.timestamptemplate.i1.toString().length,msg:"timestamptemplate.i1 length should be 5"},{actual:o(__sco.config.timestamptemplate.i),res:"number"==typeof __sco.config.timestamptemplate.i,msg:"timestamptemplate i should be a number"},{actual:o(__sco.config.timestamptemplate.i1),res:"number"==typeof __sco.config.timestamptemplate.i1,msg:"timestamptemplate i1 should be a number"},{actual:__sco.config.timestamptemplate.i.toString()+" === "+__sco.config.doc.i.toString(),res:__sco.config.timestamptemplate.i===__sco.config.doc.i,msg:"timestamptemplate i should match doc i"},{actual:__sco.config.timestamptemplate.i1.toString()+" === "+__sco.config.doc.i1.toString(),res:__sco.config.timestamptemplate.i1===__sco.config.doc.i1,msg:"timestamptemplate i1 should match doc i1"},{actual:__sco.config.guid,res:36===__sco.config.guid.toString().length,msg:"sco guid length should be 36"},{actual:__sco.config.v1guid,res:36===__sco.config.v1guid.toString().length,msg:"sco v1guid length should be 36"}]}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};t["default"]=s},function(e,t){"use strict";function s(){return[function(e){var t=__sco.osr.config.pageConfigs.reduce(function(e,t){var s=t.validPages.filter(function(e){return window.location.href.indexOf(e)>-1});return s.length>0?e.concat(t.validPages):void 0},[]);e({actual:JSON.stringify(t),res:t.length>0,msg:"__sco.osr.config.pageConfigs should have current location.href"})}]}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=s},function(e,t){"use strict";function s(){return[function(e){__sco.sender.send("GET","https://d30ke5tqu2tkyx.cloudfront.net/import/lite/provider.aspx?id="+__sco.config.guid,"",function(t){var s=JSON.parse(t.target.responseText.split("scobj = ")[1].split("//]]")[0]);e(o("V1",s))})},function(e){__sco.sender.send("GET","https://d22j4fzzszoii2.cloudfront.net/provider?id="+__sco.config.guid,"",function(t){var s=JSON.parse(t.target.responseText.split("scobj = ")[1].split("</script>")[0].replace(/[\r\n\s]/g,"").replace(/\'/g,'"').replace(/relatedclientids/i,'"RelatedClientIds"'));e(o("V2",s))})}]}function o(e,t){return{actual:JSON.stringify(t.referrers),res:t.referrers.filter(function(e){return window.location.href.indexOf(e)>-1}).length>0,msg:e+" referrers should contain current url"}}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=s}]); |