Skip to content

Commit

Permalink
test(fix-dialog-size): [snapshot] fix ut of PortalHost and update sna…
Browse files Browse the repository at this point in the history
…pshot
  • Loading branch information
233mawile authored and 233mawile-rc committed May 25, 2022
1 parent c92cec7 commit 39f9456
Show file tree
Hide file tree
Showing 10 changed files with 160 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ exports[`Storyshots 🚀 Cleanup Components/Dialog/Dialog Dialog 1`] = `
}
}
@media (max-width:463.95px) {
}
<button
className="MuiButtonBase-root MuiButton-root MuiButton-contained RcButton-contained c0"
disabled={false}
Expand Down Expand Up @@ -210,6 +214,10 @@ Array [
}
@media (max-width:463.95px) {
}
@media (hover:hover) and (pointer:fine) {
.c1.RcSwitch-root:hover .RcSwitch-switchBase:not(.RcSwitch-disabled) + .RcSwitch-track {
background-color: rgba(147,147,147,0.92);
Expand Down Expand Up @@ -282,6 +290,10 @@ Array [
}
@media (max-width:463.95px) {
}
@media (hover:hover) and (pointer:fine) {
}
Expand Down Expand Up @@ -349,6 +361,10 @@ Array [
}
@media (max-width:463.95px) {
}
@media (hover:hover) and (pointer:fine) {
}
Expand Down Expand Up @@ -503,6 +519,10 @@ Array [
}
@media (max-width:463.95px) {
}
@media (hover:hover) and (pointer:fine) {
}
Expand Down Expand Up @@ -570,6 +590,10 @@ Array [
}
@media (max-width:463.95px) {
}
@media (hover:hover) and (pointer:fine) {
}
Expand Down Expand Up @@ -724,6 +748,10 @@ Array [
}
@media (max-width:463.95px) {
}
@media (hover:hover) and (pointer:fine) {
}
Expand Down Expand Up @@ -808,6 +836,10 @@ Array [
}
}
@media (max-width:463.95px) {
}
@media (hover:hover) and (pointer:fine) {
}
Expand Down Expand Up @@ -919,6 +951,10 @@ exports[`Storyshots 🚀 Cleanup Components/Dialog/Dialog Dialog with responsive
}
}
@media (max-width:463.95px) {
}
<button
className="MuiButtonBase-root MuiButton-root MuiButton-contained RcButton-contained c0"
disabled={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6184,6 +6184,10 @@ Array [

}

@media (max-width:463.95px) {

}

@media (hover:hover) and (pointer:fine) {
.c1 .RcTextFieldInput-root:hover:not(.RcTextFieldInput-disabled) .c10 {
display: -webkit-inline-box;
Expand Down Expand Up @@ -7755,6 +7759,10 @@ Array [

}

@media (max-width:463.95px) {

}

@media (hover:hover) and (pointer:fine) {
.c1 .RcTextFieldInput-root:hover:not(.RcTextFieldInput-disabled) .c11 {
display: -webkit-inline-box;
Expand Down Expand Up @@ -9155,6 +9163,10 @@ Array [

}

@media (max-width:463.95px) {

}

@media (hover:hover) and (pointer:fine) {
.c1 .RcTextFieldInput-root:hover:not(.RcTextFieldInput-disabled) .c10 {
display: -webkit-inline-box;
Expand Down Expand Up @@ -10550,6 +10562,10 @@ Array [
}
}

@media (max-width:463.95px) {

}

@media (hover:hover) and (pointer:fine) {
.c1 .RcTextFieldInput-root:hover:not(.RcTextFieldInput-disabled) .c10 {
display: -webkit-inline-box;
Expand Down Expand Up @@ -11472,6 +11488,10 @@ Array [

}

@media (max-width:463.95px) {

}

@media (hover:hover) and (pointer:fine) {

}
Expand Down Expand Up @@ -11632,6 +11652,10 @@ Array [

}

@media (max-width:463.95px) {

}

@media (hover:hover) and (pointer:fine) {

}
Expand Down Expand Up @@ -11792,6 +11816,10 @@ Array [

}

@media (max-width:463.95px) {

}

@media (hover:hover) and (pointer:fine) {

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ Array [
}
@media (max-width:463.95px) {
}
<button
className="MuiButtonBase-root MuiButton-root MuiButton-contained RcButton-contained c0"
disabled={false}
Expand Down Expand Up @@ -242,6 +246,10 @@ Array [
}
@media (max-width:463.95px) {
}
<br />,
@media (hover:hover) and (pointer:fine) {
Expand All @@ -267,6 +275,10 @@ Array [
}
@media (max-width:463.95px) {
}
<br />,
.c0 {
text-transform: none;
Expand Down Expand Up @@ -355,6 +367,10 @@ Array [
}
@media (max-width:463.95px) {
}
<button
className="MuiButtonBase-root MuiButton-root MuiButton-contained RcButton-contained c0"
disabled={false}
Expand Down Expand Up @@ -414,6 +430,10 @@ Array [
}
@media (max-width:463.95px) {
}
<h5
className="MuiTypography-root c0 MuiTypography-paragraph MuiTypography-displayBlock"
data-color="neutral.f06"
Expand Down Expand Up @@ -509,6 +529,10 @@ Array [
}
}
@media (max-width:463.95px) {
}
<button
className="MuiButtonBase-root MuiButton-root MuiButton-contained RcButton-contained c0"
disabled={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ exports[`Storyshots 🚀 Cleanup Components/PopupBox PopupBox 1`] = `
}
}
@media (max-width:463.95px) {
}
<button
className="MuiButtonBase-root MuiButton-root MuiButton-contained RcButton-contained c0"
disabled={false}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import '@testing-library/jest-dom/extend-expect';

import React, { FunctionComponent, useRef } from 'react';

import '@testing-library/jest-dom/extend-expect';
import { render } from '@ringcentral/juno-test';
import {
act,
cleanup,
fireEvent,
render,
screen,
waitFor,
waitForElementToBeRemoved,
Expand Down Expand Up @@ -90,6 +91,12 @@ type ManagerHandlerProps<P extends {} = {}> = {
manager: PortalManager;
};

const setup = () => {
const manager = new PortalManager();
render(<RcPortalHost manager={manager} />);
return manager;
};

describe('Close portal', () => {
it.each([
[
Expand Down Expand Up @@ -118,8 +125,7 @@ describe('Close portal', () => {
},
],
])('Should close portal correctly (%s)', async (_, handleClose) => {
const manager = new PortalManager();
render(<RcPortalHost manager={manager} />);
const manager = setup();

const controller = manager.open(TestComponent);

Expand All @@ -140,8 +146,7 @@ describe('Close portal', () => {
});

it('Should close all portal after invoke manager.closeAll', async () => {
const portalManager = new PortalManager();
render(<RcPortalHost manager={portalManager} />);
const portalManager = setup();

portalManager.open(TestComponent);
portalManager.open(TestComponent);
Expand Down Expand Up @@ -192,8 +197,7 @@ describe('Update props', () => {
},
],
])('Should update props correctly (%s)', async (_, handleUpdate) => {
const manager = new PortalManager();
render(<RcPortalHost manager={manager} />);
const manager = setup();

const controller = manager.open(TestComponent, {
props: { text: '24' },
Expand All @@ -220,8 +224,7 @@ describe('Update props', () => {

describe('Check order', () => {
it('The last one to open should be at the top', async () => {
const manager = new PortalManager();
render(<RcPortalHost manager={manager} />);
const manager = setup();

manager.open(TestComponent, {
props: { 'data-test-automation-id': 'A' } as any,
Expand All @@ -243,8 +246,7 @@ describe('Check order', () => {

describe('feedback', () => {
it('Should get feedback correctly after close dialog', async () => {
const portalManager = new PortalManager();
render(<RcPortalHost manager={portalManager} />);
const portalManager = setup();

const controller1 = portalManager.open(TestComponent, {
props: { feedback: 'feed1' },
Expand Down Expand Up @@ -298,8 +300,7 @@ describe('feedback', () => {
});

it('Should get feedback `undefined` after close all dialog', async () => {
const portalManager = new PortalManager();
render(<RcPortalHost manager={portalManager} />);
const portalManager = setup();

const controller1 = portalManager.open(TestComponent, {
props: { feedback: 'feed1' },
Expand Down Expand Up @@ -331,8 +332,7 @@ describe('feedback', () => {
});

it('Should clean `portalManager._feedbackMap` after close dialog', async () => {
const portalManager = new PortalManager();
render(<RcPortalHost manager={portalManager} />);
const portalManager = setup();

const controller = portalManager.open(TestComponent, {
props: { feedback: 'feeeed' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Array [
color: #BE3933;
}
@media (max-width:463.95px) {
}
<p
className="MuiTypography-root c0"
data-color="danger.f02"
Expand All @@ -34,6 +38,10 @@ Array [
overflow: hidden;
}
@media (max-width:463.95px) {
}
<div
className="c0"
>
Expand Down
Loading

0 comments on commit 39f9456

Please sign in to comment.