mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-08-29 14:28:37 +02:00
big locale logic switchover
This commit is contained in:
parent
c1e7274c72
commit
811b9c1b0e
8 changed files with 121 additions and 46 deletions
|
@ -1,31 +1,43 @@
|
|||
var CasperUtils = require('./casperUtils').CasperUtils;
|
||||
|
||||
var intl = require('../../js/intl/index.js');
|
||||
|
||||
var langLocaleMap = intl.langLocaleMap;
|
||||
|
||||
casper.start(
|
||||
CasperUtils.getUrl(),
|
||||
function() {
|
||||
this.test.assertTitle('Learn Git Branching');
|
||||
|
||||
casper.waitFor(CasperUtils.waits.jsMount)
|
||||
.then(CasperUtils.multiAssert(
|
||||
CasperUtils.asserts.visibleIDs([
|
||||
'commandLineHistory',
|
||||
'terminal',
|
||||
'interfaceWrapper',
|
||||
'mainVisSpace',
|
||||
'commandLineBar'
|
||||
]),
|
||||
CasperUtils.asserts.visibleSelectors([
|
||||
'div.visBackgroundColor',
|
||||
'p.commandLine'
|
||||
])
|
||||
))
|
||||
.then(CasperUtils.asserts.visibleIDs([
|
||||
'commandLineHistory',
|
||||
]))
|
||||
.then(function() {
|
||||
|
||||
.waitFor(CasperUtils.waits.allCommandsFinished)
|
||||
|
||||
.then(
|
||||
CasperUtils.asserts.visibleSelectors(['p.finished'])
|
||||
)
|
||||
Object.keys(langLocaleMap).forEach(function(lang) {
|
||||
var locale = langLocaleMap[lang];
|
||||
this.test.assertEvalEquals(function(lang) {
|
||||
debug_App_changeLocaleFromHeaders(lang);
|
||||
return debug_Intl_getLocale();
|
||||
},
|
||||
locale,
|
||||
'Testing changing the locale from ' + lang +
|
||||
' to ' + locale,
|
||||
{ lang: lang }
|
||||
);
|
||||
|
||||
this.test.assertEvalEquals(function(lang) {
|
||||
debug_App_changeLocaleFromHeaders(lang);
|
||||
return debug_Intl_getLocale();
|
||||
},
|
||||
locale,
|
||||
'Testing changing the locale from ' + lang +
|
||||
' to ' + locale,
|
||||
{ lang: lang }
|
||||
);
|
||||
}.bind(this));
|
||||
})
|
||||
.then(CasperUtils.testDone);
|
||||
|
||||
}).run();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue