Merged in bugfix/textarea-not-showing (pull request #16)

Fix textarea not showing
Approved-by: Paulo Veiga
This commit is contained in:
Matias Arriola 2021-12-22 16:52:30 +00:00 committed by Paulo Veiga
commit af83ff5351
4 changed files with 17 additions and 8 deletions

View File

@ -3,7 +3,10 @@ import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command';
// make matchImageSnapshot() call the real implementation only if CYPRESS_imageSnaphots is set // make matchImageSnapshot() call the real implementation only if CYPRESS_imageSnaphots is set
// otherwise it calls a noop // otherwise it calls a noop
if (Cypress.env('imageSnaphots')) { if (Cypress.env('imageSnaphots')) {
addMatchImageSnapshotCommand(); addMatchImageSnapshotCommand({
failureThreshold: 0.001,
failureThresholdType: 'percent',
});
} else { } else {
Cypress.Commands.add( Cypress.Commands.add(
'matchImageSnapshot', 'matchImageSnapshot',

View File

@ -3,7 +3,10 @@ import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command';
// make matchImageSnapshot() call the real implementation only if CYPRESS_imageSnaphots is set // make matchImageSnapshot() call the real implementation only if CYPRESS_imageSnaphots is set
// otherwise it calls a noop // otherwise it calls a noop
if (Cypress.env('imageSnaphots')) { if (Cypress.env('imageSnaphots')) {
addMatchImageSnapshotCommand(); addMatchImageSnapshotCommand({
failureThreshold: 0.001,
failureThresholdType: 'percent',
});
} else { } else {
Cypress.Commands.add( Cypress.Commands.add(
'matchImageSnapshot', 'matchImageSnapshot',

View File

@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import { $defined } from '@wisemapping/core-js'; import { $assert, $defined } from '@wisemapping/core-js';
class Font { class Font {
constructor() { constructor() {
@ -26,7 +26,7 @@ class Font {
init(args) { init(args) {
if ($defined(args.size)) { if ($defined(args.size)) {
this._size = parseInt(args.size, 10); this._size = Number.parseInt(args.size, 10);
} }
if ($defined(args.style)) { if ($defined(args.style)) {
this._style = args.style; this._style = args.style;
@ -68,7 +68,9 @@ class Font {
return this._weight; return this._weight;
} }
setSize(size) { setSize(value) {
const size = Number.parseInt(value, 10);
$assert(!Number.isFinite(size), 'size must be a valid integer');
this._size = size; this._size = size;
} }

View File

@ -1,12 +1,13 @@
import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command'; import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command';
import '@testing-library/cypress/add-commands'; import '@testing-library/cypress/add-commands';
addMatchImageSnapshotCommand();
// make matchImageSnapshot() call the real implementation only if CYPRESS_imageSnaphots is set // make matchImageSnapshot() call the real implementation only if CYPRESS_imageSnaphots is set
// otherwise it calls a noop // otherwise it calls a noop
if (Cypress.env('imageSnaphots')) { if (Cypress.env('imageSnaphots')) {
addMatchImageSnapshotCommand(); addMatchImageSnapshotCommand({
failureThreshold: 0.001,
failureThresholdType: 'percent',
});
} else { } else {
Cypress.Commands.add( Cypress.Commands.add(
'matchImageSnapshot', 'matchImageSnapshot',