Skip to content

Commit

Permalink
Rollback to previous commit for test
Browse files Browse the repository at this point in the history
Enact-DCO-1.0-Signed-off-by: Hyelyn Kim (myelyn.kim@lge.com)
  • Loading branch information
mmyelyn committed Oct 7, 2024
1 parent 17891d4 commit 0bb2e53
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions ContextualPopupDecorator/tests/ContextualPopupDecorator-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const keyDown = (keyCode) => (picker) => fireEvent.keyDown(picker, {keyCode});

const leftKeyDown = keyDown(37);

let MockObserverInstance;

describe('ContextualPopupDecorator Specs', () => {
beforeEach(() => {
global.Element.prototype.getBoundingClientRect = jest.fn(() => {
Expand All @@ -25,6 +27,12 @@ describe('ContextualPopupDecorator Specs', () => {
right: 0
};
});

MockObserverInstance = {
observe: jest.fn(),
disconnect: jest.fn()
};
global.ResizeObserver = jest.fn().mockImplementation(() => MockObserverInstance);
});

test('should emit onOpen event with type when opening', () => {
Expand Down Expand Up @@ -507,14 +515,14 @@ describe('ContextualPopupDecorator Specs', () => {
});

test('should create and observe with `ResizeObserver` and disconnect when the popup close', () => {
const originalObserver = global.ResizeObserver;
//const originalObserver = global.ResizeObserver;

const MockObserverInstance = {
/*const MockObserverInstance = {
observe: jest.fn(),
disconnect: jest.fn()
};
global.ResizeObserver = jest.fn().mockImplementation(() => MockObserverInstance);

*/
const message = 'goodbye';
const Root = FloatingLayerDecorator('div');
render(
Expand All @@ -541,6 +549,6 @@ describe('ContextualPopupDecorator Specs', () => {
expect(MockObserverInstance.disconnect).toHaveBeenCalled();
*/
global.ResizeObserver = originalObserver;
//global.ResizeObserver = originalObserver;
});
});

0 comments on commit 0bb2e53

Please sign in to comment.