mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-28 17:00:04 +02:00
intl change locale tested
This commit is contained in:
parent
adbe798b25
commit
d45651aad2
2 changed files with 44 additions and 2 deletions
42
src/__tests__/casperjs/helper_bar_intl_test.js
Normal file
42
src/__tests__/casperjs/helper_bar_intl_test.js
Normal file
|
@ -0,0 +1,42 @@
|
|||
var CasperUtils = require('./casperUtils').CasperUtils;
|
||||
|
||||
casper.start(
|
||||
CasperUtils.getUrl(),
|
||||
function() {
|
||||
|
||||
casper.waitFor(CasperUtils.waits.jsMount)
|
||||
.then(CasperUtils.asserts.visibleSelectors([
|
||||
'a.intl',
|
||||
'a.commands',
|
||||
'a.fb',
|
||||
'div.helperBar'
|
||||
]))
|
||||
.then(CasperUtils.screenshot.entirePage)
|
||||
.then(function() {
|
||||
this.mouse.click('a.intl');
|
||||
})
|
||||
.then(CasperUtils.waits.selectorVisible(
|
||||
'a.english'
|
||||
))
|
||||
.wait(1000)
|
||||
.then(CasperUtils.screenshot.entirePage)
|
||||
.then(CasperUtils.asserts.visibleSelectors([
|
||||
'a.english',
|
||||
'a.korean',
|
||||
'a.japanese',
|
||||
'a.simpchinese'
|
||||
]))
|
||||
.then(function() {
|
||||
this.mouse.click('a.japanese');
|
||||
})
|
||||
.wait(500)
|
||||
.then(function() {
|
||||
var locale = this.evaluate(function() {
|
||||
return debug_Intl_getLocale();
|
||||
});
|
||||
// Successfully changed locale
|
||||
this.test.assert(locale === 'ja');
|
||||
})
|
||||
.then(CasperUtils.testDone);
|
||||
}).run();
|
||||
|
|
@ -30,9 +30,9 @@ var toGlobalize = {
|
|||
Intl: require('../intl')
|
||||
};
|
||||
|
||||
_.each(toGlobalize, function(module) {
|
||||
_.each(toGlobalize, function(module, moduleName) {
|
||||
for (var key in module) {
|
||||
window['debug_' + key] = module[key];
|
||||
window['debug_' + moduleName + '_' + key] = module[key];
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue