rx-page-objects
Advanced tools
Comparing version 1.34.0 to 1.35.0
@@ -10,2 +10,3 @@ /*jshint node:true*/ | ||
@param {rxBulkSelect} [options.instance=] - Component to exercise. | ||
@param {string[]} [options.batchActions] - List of batch actions to exercise, will not run exercises if empty. | ||
@param {number} [options.count=10] - Number of items in the table. | ||
@@ -26,3 +27,4 @@ @param {string} [options.cssSelector=] - DEPRECATED: Fallback selector string to initialize widget with. | ||
options = _.defaults(options, { | ||
count: 10 | ||
count: 10, | ||
batchActions: [] | ||
}); | ||
@@ -105,2 +107,37 @@ | ||
if (options.batchActions.length > 0) { | ||
it('should have a batch actions menu', function () { | ||
expect(component.batchActions.isPresent()).to.eventually.be.true; | ||
}); | ||
it('should disable the batch actions menu when no items selected', function () { | ||
expect(component.batchActions.isEnabled()).to.eventually.be.false; | ||
}); | ||
it('should enable the batch actions menu when an item is selected', function () { | ||
component.row(0).select(); | ||
expect(component.batchActions.isEnabled()).to.eventually.be.true; | ||
}); | ||
it('should expand the batch action menu when clicked', function () { | ||
component.batchActions.expand(); | ||
expect(component.batchActions.isExpanded()).to.eventually.be.true; | ||
}); | ||
it('should have the correct number of batch actions', function () { | ||
expect(component.batchActions.actionCount()).to.eventually.eql(options.batchActions.length); | ||
}); | ||
_.each(options.batchActions, function (action) { | ||
it('should have the batch action "' + action + '"', function () { | ||
expect(component.batchActions.hasAction(action)).to.eventually.be.true; | ||
}); | ||
it('should be able to open the modal for batch action "' + action + '"', function () { | ||
var modal = component.batchActions.action(action).openModal(); | ||
expect(modal.isDisplayed()).to.eventually.be.true; | ||
modal.close(); | ||
}); | ||
}); | ||
} | ||
}; | ||
@@ -107,0 +144,0 @@ }; |
@@ -5,3 +5,3 @@ { | ||
"description": "Midway test page objects for all of the Encore UI components", | ||
"version": "1.34.0", | ||
"version": "1.35.0", | ||
"main": "index.js", | ||
@@ -8,0 +8,0 @@ "license": "Apache License, Version 2.0", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
392658
6033