Skip to content

Commit

Permalink
Adjust tests for bs4
Browse files Browse the repository at this point in the history
  • Loading branch information
Talv committed Jan 13, 2018
1 parent 02033b4 commit 64add2d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 5 deletions.
32 changes: 28 additions & 4 deletions test/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,18 @@ define(function () {
// jqueryui_ver = '1.9.1',
bs2_ver = '232',
bs3_ver = '300',
bs4_ver = '400',
//path aliases
paths = {
"bootstrap": "../test/libs/bootstrap"+(f === 'bootstrap2' ? bs2_ver : bs3_ver),
"bootstrap": "../test/libs/bootstrap"+({'bootstrap2': bs2_ver, 'bootstrap3': bs3_ver, 'bootstrap4': bs4_ver}[f]),

// "jqueryui": "../test/libs/jquery-ui-"+jqueryui_ver+".custom",
"jqueryui_js": "../test/libs/jquery-ui-"+jqueryui_ver+".custom/js/jquery-ui-"+jqueryui_ver+".custom",

"dateui_js": "inputs/dateui/jquery-ui-datepicker/js/jquery-ui-"+jqueryui_ver+".custom",

"poshytip": "../test/libs/poshytip",

"test": "../test"
},

Expand Down Expand Up @@ -107,6 +108,10 @@ define(function () {
'editable-form/editable-form',
'bootstrap/js/bootstrap'
],
'editable-form/editable-form-bootstrap4': [
'editable-form/editable-form',
'bootstrap/js/bootstrap'
],
'containers/editable-popover': [
'containers/editable-inline',
'bootstrap/js/bootstrap'
Expand All @@ -115,6 +120,10 @@ define(function () {
'containers/editable-inline',
'bootstrap/js/bootstrap'
],
'containers/editable-popover4': [
'containers/editable-inline',
'bootstrap/js/bootstrap'
],
'inputs/date/date': {
deps: ['require',
'bootstrap/js/bootstrap',
Expand Down Expand Up @@ -156,7 +165,7 @@ define(function () {
'inputs/abstract'],
init: function(require) {
loadCss(require.toUrl("./lib/select2.css"));
if (f === 'bootstrap2' || f === 'bootstrap3') {
if (f === 'bootstrap2' || f === 'bootstrap3' || f === 'bootstrap4') {
loadCss(require.toUrl("./lib/select2-bootstrap.css"));
}
}
Expand Down Expand Up @@ -251,6 +260,19 @@ define(function () {

shim['element/editable-element'].deps.push('editable-form/editable-form-bootstrap3');
shim['element/editable-element'].deps.push('containers/editable-popover3');
} else if(f === 'bootstrap4') {
//bootstrap 4
shim['editable-form/editable-form'].deps = shim['editable-form/editable-form'].deps.concat(
[
'inputs/date/datefield',
'inputs/datetime/datetimefield',
'inputs-ext/typeaheadjs/typeaheadjs'
//'inputs-ext/wysihtml5/wysihtml5',
//'inputs/typeahead'
]);

shim['element/editable-element'].deps.push('editable-form/editable-form-bootstrap4');
shim['element/editable-element'].deps.push('containers/editable-popover4');
} else if(f === 'bootstrap2') {
//bootstrap 2
shim['editable-form/editable-form'].deps = shim['editable-form/editable-form'].deps.concat(
Expand All @@ -272,7 +294,7 @@ define(function () {
shim['editable-form/editable-form'].deps.push('inputs/dateui/dateuifield');
shim['inputs/dateui/dateui'].push('dateui_js');
shim['element/editable-element'].deps.push('containers/editable-poshytip');
}
}


/*
Expand All @@ -292,6 +314,8 @@ define(function () {
f = 'jqueryui';
} else if(url.match(/f=plain/i)) {
f = 'plain';
} else if(url.match(/f=bootstrap4/i) || url.match(/f=bs4/i)) {
f = 'bootstrap4';
} else if(url.match(/f=bootstrap3/i) || url.match(/f=bs3/i)) {
f = 'bootstrap3';
} else {
Expand Down
13 changes: 12 additions & 1 deletion test/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,18 @@ require(["loader", jqurl], function(loader) {
'test/unit/typeaheadjs'
];
break;


case 'bootstrap4':
custom = [
'test/unit/datefield',
'test/unit/date',
'test/unit/datetimefield',
'test/unit/datetime',
//'test/unit/wysihtml5'
'test/unit/typeaheadjs'
];
break;

default:
custom = ['test/unit/dateuifield', 'test/unit/dateui'];
}
Expand Down

0 comments on commit 64add2d

Please sign in to comment.