New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rx-page-objects

Package Overview
Dependencies
Maintainers
1
Versions
182
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rx-page-objects - npm Package Compare versions

Comparing version 1.23.1 to 1.24.0

rx-page-objects-1.24.0.tgz

133

exercise.js

@@ -286,6 +286,2 @@ /*jshint node:true*/

it('should be a checkbox type', function () {
expect(component.isCheckbox()).to.eventually.be.true;
});
it('should be present', function () {

@@ -295,2 +291,6 @@ expect(component.isPresent()).to.eventually.be.true;

it('should be a checkbox', function () {
expect(component.isCheckbox()).to.eventually.be.true;
});
it('should ' + (options.visible ? 'be' : 'not be') + ' visible', function () {

@@ -308,2 +308,28 @@ expect(component.isDisplayed()).to.eventually.eq(options.visible);

if (options.disabled) {
it('should not respond to selecting and unselecting', function () {
component.isSelected().then(function (selected) {
selected ? component.deselect() : component.select();
expect(component.isSelected()).to.eventually.equal(selected);
// even though it "doesn't respond to selecting and unselecting"
// attempt to put it back anyway in case it did actually respond.
// that way nobody accidentally submits a swapped checkbox after
// running these exercises.
selected ? component.select() : component.deselect();
expect(component.isSelected()).to.eventually.equal(selected);
});
});
} else {
it('should respond to selecting and unselecting', function () {
component.isSelected().then(function (selected) {
selected ? component.deselect() : component.select();
expect(component.isSelected()).to.eventually.not.equal(selected);
// exercises should never alter the state of a page.
// always put it back when you're done.
selected ? component.select() : component.deselect();
expect(component.isSelected()).to.eventually.equal(selected);
});
});
}
it('should ' + (options.valid ? 'be' : 'not be') + ' valid', function () {

@@ -457,2 +483,86 @@ expect(component.isValid()).to.eventually.eq(options.valid);

var rxMetadata = require('./index').rxMetadata;
/**
* rxMetadata exercises
* @exports encore.exercise.rxMetadata
* @param {Object} [options=] Test options. Used to build valid tests.
* @param {string} [options.cssSelector=] Fallback selector string to initialize widget with.
* @param {Boolean} [options.present=true] Determines if the metadata is present in the DOM
* @param {Boolean} [options.visible=true] Determines if the metadata is visible
* @param {Object} [transformFns=] - Transformation functions to be passed to rxMetadata
* @param {Object} [options.terms=] The expected label text of each metadata entry
* @example
* ```js
* describe('metadata', encore.exercise.rxMetadata({
* transformFns: {
* 'Signup Date': function (elem) {
* return elem.getText().then(function (text) {
* return new Date(text);
* });
* },
* 'Overdue Balance': function (elem) {
* return elem.getText().then(encore.rxMisc.currencyToPennies);
* },
* 'Current Due': function (elem) {
* return elem.getText().then(encore.rxMisc.currencyToPennies);
* },
* 'Expiration Date' function (elem) {
* return elem.getText().then(function (text) {
* return new Date(text);
* });
* }
* },
* terms: {
* 'Signup Date': new Date('March 1st, 2011'),
* 'Overdue Balance': 13256,
* 'Current Due': 64400,
* 'Expiration Date': new Date('January 1st, 2021')
* }
* }));
* ```
*/
exports.rxMetadata = function (options) {
if (options === undefined) {
options = {};
}
options = _.defaults(options, {
present: true,
visible: true,
});
return function () {
var component;
before(function () {
if (options.cssSelector === undefined) {
// don't use main -- you need to be able to supply `transformFns` via `initialize`
component = rxMetadata.initialize($('rx-metadata'), options.transformFns);
} else {
component = rxMetadata.initialize($(options.cssSelector), options.transformFns);
}
});
it('should ' + (options.present ? 'be' : 'not be') + ' present', function () {
expect(component.isPresent()).to.eventually.eq(options.present);
});
it('should ' + (options.visible ? 'be' : 'not be') + ' visible', function () {
expect(component.isDisplayed()).to.eventually.eq(options.visible);
});
_.forEach(options.terms, function (definition, term) {
it('should have the correct definition for ' + term, function () {
if (_.isObject(definition) || _.isArray(definition)) {
expect(component.term(term)).to.eventually.eql(definition);
} else {
expect(component.term(term)).to.eventually.equal(definition);
}
});
});
};
};
var rxOptionTable = require('./index').rxOptionTable;

@@ -725,6 +835,2 @@

it('should be a radio type', function () {
expect(component.isRadio()).to.eventually.be.true;
});
it('should be present', function () {

@@ -734,2 +840,6 @@ expect(component.isPresent()).to.eventually.be.true;

it('should be a radio button', function () {
expect(component.isRadio()).to.eventually.be.true;
});
it('should ' + (options.visible ? 'be' : 'not be') + ' visible', function () {

@@ -848,2 +958,3 @@ expect(component.isDisplayed()).to.eventually.eq(options.visible);

* @param {Boolean} [options.valid=true] - Determines if the select is valid
* @param {String} selectedText - The expected selected text of the dropdown.
*/

@@ -887,2 +998,8 @@ exports.rxSelect = function (options) {

});
if (options.selectedText) {
it('should have the correct selected option already chosen', function () {
expect(component.selectedOption.text).to.eventually.equal(options.selectedText);
});
}
};

@@ -889,0 +1006,0 @@ };

2

package.json

@@ -5,3 +5,3 @@ {

"description": "Midway test page objects for all of the Encore UI components",
"version": "1.23.1",
"version": "1.24.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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc