@shko.online/componentframework-mock
Version:
Mocking library to help with testing PowerApps Component Framework Components
40 lines (38 loc) • 1.31 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ModeMock = void 0;
var _sinon = require("sinon");
/*
Copyright (c) 2022 Betim Beja and Shko Online LLC
Licensed under the MIT license.
*/
class ModeMock {
constructor() {
this.allocatedHeight = void 0;
this.allocatedWidth = void 0;
this.isControlDisabled = void 0;
this.isVisible = void 0;
this.label = void 0;
this.setControlState = void 0;
this._FullScreen = void 0;
this._TrackingContainerResize = void 0;
this.setFullScreen = void 0;
this.trackContainerResize = void 0;
this.allocatedHeight = -1;
this.allocatedWidth = -1;
this.isVisible = true;
this.isControlDisabled = false;
this.label = 'Mocked with @shko.online/componentframework-mock';
this.setControlState = (0, _sinon.stub)(); // this is mocked in ComponentFrameworkMockGenerator
this._FullScreen = false;
this.setFullScreen = (0, _sinon.stub)(); // this is mocked in mockNotifyOutputChanged
this.trackContainerResize = (0, _sinon.stub)(); // this is mocked in ComponentFrameworkMockGenerator
this.trackContainerResize.callsFake(value => {
this._TrackingContainerResize = value;
});
this._TrackingContainerResize = false;
}
}
exports.ModeMock = ModeMock;