-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge "[INTERNAL] sap.ui.ux3: migrate tests to new generic test starter"
- Loading branch information
Showing
42 changed files
with
5,879 additions
and
6,230 deletions.
There are no files selected for viewing
215 changes: 97 additions & 118 deletions
215
...est/sap/ui/ux3/qunit/ActionBar.qunit.html → .../test/sap/ui/ux3/qunit/ActionBar.qunit.js
100644 → 100755
Large diffs are not rendered by default.
Oops, something went wrong.
345 changes: 0 additions & 345 deletions
345
src/sap.ui.ux3/test/sap/ui/ux3/qunit/CollectionInspector.qunit.html
This file was deleted.
Oops, something went wrong.
323 changes: 323 additions & 0 deletions
323
src/sap.ui.ux3/test/sap/ui/ux3/qunit/CollectionInspector.qunit.js
Large diffs are not rendered by default.
Oops, something went wrong.
255 changes: 113 additions & 142 deletions
255
.../test/sap/ui/ux3/qunit/DataSet.qunit.html → ...x3/test/sap/ui/ux3/qunit/DataSet.qunit.js
100644 → 100755
Large diffs are not rendered by default.
Oops, something went wrong.
164 changes: 0 additions & 164 deletions
164
src/sap.ui.ux3/test/sap/ui/ux3/qunit/DataSetPagination.qunit.html
This file was deleted.
Oops, something went wrong.
153 changes: 153 additions & 0 deletions
153
src/sap.ui.ux3/test/sap/ui/ux3/qunit/DataSetPagination.qunit.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
/*global QUnit */ | ||
sap.ui.define([ | ||
"sap/ui/qunit/utils/createAndAppendDiv", | ||
"sap/ui/model/json/JSONModel", | ||
"sap/ui/ux3/DataSet", | ||
"sap/ui/ux3/DataSetItem", | ||
"sap/ui/ux3/DataSetSimpleView", | ||
"sap/ui/commons/TextField" | ||
], function( | ||
createAndAppendDiv, | ||
JSONModel, | ||
DataSet, | ||
DataSetItem, | ||
DataSetSimpleView, | ||
TextField | ||
) { | ||
"use strict"; | ||
|
||
// prepare DOM | ||
createAndAppendDiv("content"); | ||
|
||
|
||
|
||
// Initialize the Model | ||
|
||
var data = {products:[]}; | ||
var aTitles = ["Notebook Basic", "UMTS PDA", "Easy Hand", "Deskjet Super Highspeed", | ||
"Copperberry Cellphone", "Notebook LCD Display", "PC Power Station", | ||
"Gaming Monster Pro", "ITelO FlexTop I4000", "ITelO FlexTop I6300c", | ||
"Goldberry Cellphone", "ITelO FlexTop I9100", "Notebook Professional", | ||
"Smart Office", "Deskjet Super Highspeed", "Notebook Basic XS", | ||
"Notebook Basic", "UMTS PDA", "Easy Hand", "Deskjet Super Highspeed", | ||
"Copperberry Cellphone", "Notebook LCD Display", "PC Power Station", | ||
"Gaming Monster Pro", "ITelO FlexTop I4000", "ITelO FlexTop I6300c", | ||
"Goldberry Cellphone", "ITelO FlexTop I9100", "Notebook Professional", | ||
"Smart Office", "Deskjet Super Highspeed", "Notebook Basic XS", | ||
"Notebook Basic", "UMTS PDA", "Easy Hand", "Deskjet Super Highspeed", | ||
"Copperberry Cellphone", "Notebook LCD Display", "PC Power Station", | ||
"Gaming Monster Pro", "ITelO FlexTop I4000", "ITelO FlexTop I6300c", | ||
"Goldberry Cellphone", "ITelO FlexTop I9100", "Notebook Professional", | ||
"Smart Office", "Deskjet Super Highspeed", "Notebook Basic XS", | ||
"Notebook Basic", "UMTS PDA", "Easy Hand", "Deskjet Super Highspeed", | ||
"Copperberry Cellphone", "Notebook LCD Display", "PC Power Station", | ||
"Gaming Monster Pro", "ITelO FlexTop I4000", "ITelO FlexTop I6300c", | ||
"Goldberry Cellphone", "ITelO FlexTop I9100", "Notebook Professional", | ||
"Smart Office", "Deskjet Super Highspeed", "Notebook Basic XS", | ||
"Notebook Basic", "UMTS PDA", "Easy Hand", "Deskjet Super Highspeed", | ||
"Copperberry Cellphone", "Notebook LCD Display", "PC Power Station", | ||
"Gaming Monster Pro", "ITelO FlexTop I4000", "ITelO FlexTop I6300c", | ||
"Goldberry Cellphone", "ITelO FlexTop I9100", "Notebook Professional", | ||
"Smart Office", "Deskjet Super Highspeed", "Notebook Basic XS", | ||
"Notebook Basic", "UMTS PDA", "Easy Hand", "Deskjet Super Highspeed", | ||
"Copperberry Cellphone", "Notebook LCD Display", "PC Power Station", | ||
"Gaming Monster Pro", "ITelO FlexTop I4000", "ITelO FlexTop I6300c", | ||
"Goldberry Cellphone", "ITelO FlexTop I9100", "Notebook Professional", | ||
"Smart Office", "Deskjet Super Highspeed", "Notebook Basic XS", | ||
"Gaming Monster Pro", "ITelO FlexTop I4000", "ITelO FlexTop I6300c", | ||
"Goldberry Cellphone", "ITelO FlexTop I9100", "Notebook Professional", | ||
"Smart Office", "Deskjet Super Highspeed", "Notebook Basic XS", | ||
"Notebook Basic", "UMTS PDA", "Easy Hand", "Deskjet Super Highspeed", | ||
"Copperberry Cellphone", "Notebook LCD Display", "PC Power Station", | ||
"Gaming Monster Pro", "ITelO FlexTop I4000", "ITelO FlexTop I6300c", | ||
"Goldberry Cellphone", "ITelO FlexTop I9100", "Notebook Professional", | ||
"Smart Office", "Deskjet Super Highspeed", "Notebook Basic XS", | ||
"Notebook Basic", "UMTS PDA", "Easy Hand", "Deskjet Super Highspeed", | ||
"Copperberry Cellphone", "Notebook LCD Display", "PC Power Station", | ||
"Gaming Monster Pro", "ITelO FlexTop I4000", "ITelO FlexTop I6300c", | ||
"Goldberry Cellphone", "ITelO FlexTop I9100", "Notebook Professional", | ||
"Smart Office", "Deskjet Super Highspeed", "Notebook Basic XS", | ||
"Notebook Basic", "UMTS PDA", "Easy Hand", "Deskjet Super Highspeed", | ||
"Copperberry Cellphone", "Notebook LCD Display", "PC Power Station", | ||
"Gaming Monster Pro", "ITelO FlexTop I4000", "ITelO FlexTop I6300c", | ||
"Goldberry Cellphone", "ITelO FlexTop I9100", "Notebook Professional", | ||
"Smart Office", "Deskjet Super Highspeed", "Notebook Basic XS", | ||
"Notebook Basic", "UMTS PDA", "Easy Hand", "Deskjet Super Highspeed", | ||
"Copperberry Cellphone", "Notebook LCD Display", "PC Power Station", | ||
"Gaming Monster Pro", "ITelO FlexTop I4000", "ITelO FlexTop I6300c", | ||
"Goldberry Cellphone", "ITelO FlexTop I9100", "Notebook Professional", | ||
"Smart Office", "Deskjet Super Highspeed", "Notebook Basic XS", | ||
"Notebook Basic", "UMTS PDA", "Easy Hand", "Deskjet Super Highspeed", | ||
"Copperberry Cellphone", "Notebook LCD Display", "PC Power Station", | ||
"Gaming Monster Pro", "ITelO FlexTop I4000", "ITelO FlexTop I6300c", | ||
"Goldberry Cellphone", "ITelO FlexTop I9100", "Notebook Professional", | ||
"Smart Office", "Deskjet Super Highspeed", "Notebook Basic XS"]; | ||
|
||
for (var i = 0; i < aTitles.length; i++){ | ||
var sTitle = aTitles[i]; | ||
var oProduct = {id: "" + i, price: Math.floor((Math.random() * 1000)) + 1 + " $", category: "PC", | ||
title: sTitle, rating: Math.floor((Math.random() * 5)) + 1}; | ||
if (sTitle.indexOf("Notebook") >= 0){ | ||
oProduct.category = "Notebook"; | ||
} else if (sTitle.indexOf("Cellphone") >= 0 || sTitle.indexOf("PDA") >= 0){ | ||
oProduct.category = "Mobile"; | ||
} | ||
data.products.push(oProduct); | ||
} | ||
|
||
var oModel = new JSONModel(); | ||
oModel.setData(data); | ||
|
||
var oDataSet = new DataSet({ | ||
items: { | ||
path: "/products", | ||
template: new DataSetItem({ | ||
title : "{title}" | ||
}) | ||
}, | ||
views: [ | ||
new DataSetSimpleView({ | ||
name: "Floating, non-responsive Card View", | ||
icon: "test-resources/sap/ui/ux3/images/thumbnails.png", | ||
iconHovered: "test-resources/sap/ui/ux3/images/thumbnails_hover.png", | ||
iconSelected: "test-resources/sap/ui/ux3/images/thumbnails_hover.png", | ||
floating: false, | ||
responsive: false, | ||
itemMinWidth: 0, | ||
template: new TextField({value: "{category}", editable: false}), | ||
initialItemCount: 10, | ||
reloadItemCount: 5, | ||
height: "495px" | ||
}) | ||
] | ||
}); | ||
oDataSet.setModel(oModel); | ||
oDataSet.placeAt("content"); | ||
|
||
|
||
QUnit.module("Pagination"); | ||
QUnit.test("Initial item count", function(assert) { | ||
assert.equal(sap.ui.getCore().byId(oDataSet.getSelectedView()).getInitialItemCount(), 10, "Initial item count"); | ||
assert.equal(oDataSet.getItems().length, 27, "Item count after inital reload (fill scrollarea)"); | ||
}); | ||
|
||
QUnit.test("Scrolling", function(assert) { | ||
var done = assert.async(); | ||
var $scrollArea = jQuery(".sapUiUx3DSSVSA"); | ||
$scrollArea.scrollTop($scrollArea.height()); | ||
setTimeout(function() { | ||
assert.equal(oDataSet.getItems().length, 32, "Item count after scrolling to the very bottom"); | ||
done(); | ||
}, 1000); | ||
}); | ||
|
||
QUnit.test("Scrolling 2", function(assert) { | ||
var done = assert.async(); | ||
var $scrollArea = jQuery(".sapUiUx3DSSVSA"); | ||
$scrollArea.scrollTop($scrollArea.height() + $scrollArea.scrollTop()); | ||
setTimeout(function() { | ||
assert.equal(oDataSet.getItems().length, 37, "Item count after scrolling to the very bottom"); | ||
done(); | ||
}, 1000); | ||
}); | ||
}); |
Oops, something went wrong.