diff --git a/__mocks__/core/js/views/adaptView.js b/__mocks__/core/js/views/adaptView.js deleted file mode 100644 index ac15eb656..000000000 --- a/__mocks__/core/js/views/adaptView.js +++ /dev/null @@ -1,68 +0,0 @@ -import { jest } from '@jest/globals'; - -class AdaptView { - constructor() { - this.model = { - get: jest.fn(() => { - return { - _id: 'mock-id', - _isVisible: true, - _isHidden: false, - _isComplete: true - }; - }), - set: jest.fn(), - toJSON: jest.fn(() => ({})), - getChildren: jest.fn(() => { - return { - listenTo: jest.fn() - }; - }) - }; - this.listenTo = jest.fn(); - } - - attributes() { - return { - 'data-adapt-id': this.model.get('_id'), - role: 'presentation' - }; - } - - initialize() {} - - preRender() {} - - async postRender() {} - - render() { - return this; - } - - changed() {} - - updateViewProperties() {} - - toggleVisibility() {} - - toggleHidden() {} - - onIsCompleteChange() {} - - setupOnScreenHandler() {} - - setReadyStatus() { - this.model.set('_isReady', true); - } - - setCompletionStatus() { - if (!this.model.get('_isVisible')) return; - this.model.set({ - _isComplete: true, - _isInteractionComplete: true - }); - } - -} -AdaptView.type = 'adaptView'; -export default AdaptView; diff --git a/__mocks__/core/js/views/componentView.js b/__mocks__/core/js/views/componentView.js deleted file mode 100644 index 63239e833..000000000 --- a/__mocks__/core/js/views/componentView.js +++ /dev/null @@ -1,70 +0,0 @@ -import AdaptView from './adaptView'; -import logging from '../logging'; -import { jest } from '@jest/globals'; - -class ComponentView extends AdaptView { - constructor() { - super(); - this.model = { - get: jest.fn(() => { - return { - _isA11yRegionEnabled: true, - _id: 'mock-id', - _component: 'mock-component', - _classes: 'mock-classes', - _layout: 'mock-layout', - _isComplete: true, - _isOptional: true - }; - }) - }; - this.$ = jest.fn(() => { - return { - on: jest.fn(), - off: jest.fn() - }; - }); - } - - attributes() { - return AdaptView.resultExtend('attributes', { - 'aria-labelledby': this.model.get('_id') + '-heading', - role: 'region' - }, this); - } - - className() { - return [ - 'component', - this.model.get('_component').toLowerCase(), - this.model.get('_id'), - this.model.get('_classes'), - this.setVisibility(), - this.setHidden(), - 'is-' + this.model.get('_layout'), - (this.model.get('_isComplete') ? 'is-complete' : ''), - (this.model.get('_isOptional') ? 'is-optional' : '') - ].join(' '); - } - - renderState() { - logging.removed('renderState is removed and moved to item title'); - } - - setupInviewCompletion(inviewElementSelector = '.component__inner', callback = this.setCompletionStatus) { - this.$inviewElement = this.$(inviewElementSelector); - this.inviewCallback = callback; - } - - removeInviewListener() {} - - onInview() {} - - postRender() {} - - remove() {} -} - -ComponentView.type = 'component'; - -export default ComponentView;