Skip to content

Commit 4707968

Browse files
[test] Improve visual regression tests
1 parent a992b09 commit 4707968

34 files changed

+148
-597
lines changed

docs/pages/components/material-icons.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ const req = name => {
1515
req.keys = () => ['material-icons.md', 'SearchIcons.js'];
1616
const reqPrefix = 'pages/components/material-icons';
1717

18-
function Page() {
18+
export default function Page() {
1919
return <MarkdownDocs disableToc req={req} reqSource={() => {}} reqPrefix={reqPrefix} />;
2020
}
21-
22-
export default Page;

docs/src/pages/components/modal/ServerModal.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const useStyles = makeStyles(theme => ({
66
root: {
77
height: 300,
88
flexGrow: 1,
9+
minWidth: 300,
910
transform: 'translateZ(0)',
1011
// The position fixed scoping doesn't work in IE 11.
1112
// Disable this demo to preserve the others.

docs/src/pages/components/modal/ServerModal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const useStyles = makeStyles((theme: Theme) =>
77
root: {
88
height: 300,
99
flexGrow: 1,
10+
minWidth: 300,
1011
transform: 'translateZ(0)',
1112
// The position fixed scoping doesn't work in IE 11.
1213
// Disable this demo to preserve the others.

packages/material-ui/src/utils/deprecatedPropType.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function deprecatedPropType(validator, reason) {
1+
export default function deprecatedPropType(validator, reason) {
22
if (process.env.NODE_ENV === 'production') {
33
return () => null;
44
}
@@ -17,5 +17,3 @@ function deprecatedPropType(validator, reason) {
1717
return null;
1818
};
1919
}
20-
21-
export default deprecatedPropType;

packages/material-ui/src/utils/getScrollbarSize.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// A change of the browser zoom change the scrollbar size.
22
// Credit https://github.com/twbs/bootstrap/blob/3ffe3a5d82f6f561b82ff78d82b32a7d14aed558/js/src/modal.js#L512-L519
3-
function getScrollbarSize() {
3+
export default function getScrollbarSize() {
44
const scrollDiv = document.createElement('div');
55
scrollDiv.style.width = '99px';
66
scrollDiv.style.height = '99px';
@@ -14,5 +14,3 @@ function getScrollbarSize() {
1414

1515
return scrollbarSize;
1616
}
17-
18-
export default getScrollbarSize;
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
function ownerDocument(node) {
1+
export default function ownerDocument(node) {
22
return (node && node.ownerDocument) || document;
33
}
4-
5-
export default ownerDocument;
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import ownerDocument from './ownerDocument';
22

3-
function ownerWindow(node) {
3+
export default function ownerWindow(node) {
44
const doc = ownerDocument(node);
55
return doc.defaultView || window;
66
}
7-
8-
export default ownerWindow;

packages/material-ui/src/utils/requirePropFactory.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function requirePropFactory(componentNameInError) {
1+
export default function requirePropFactory(componentNameInError) {
22
if (process.env.NODE_ENV === 'production') {
33
return () => null;
44
}
@@ -17,5 +17,3 @@ function requirePropFactory(componentNameInError) {
1717
};
1818
return requireProp;
1919
}
20-
21-
export default requirePropFactory;

packages/material-ui/src/utils/unsupportedProp.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function unsupportedProp(props, propName, componentName, location, propFullName) {
1+
export default function unsupportedProp(props, propName, componentName, location, propFullName) {
22
if (process.env.NODE_ENV === 'production') {
33
return null;
44
}
@@ -11,5 +11,3 @@ function unsupportedProp(props, propName, componentName, location, propFullName)
1111

1212
return null;
1313
}
14-
15-
export default unsupportedProp;

test/regressions/debug.html

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,23 @@
22
<html>
33
<head>
44
<title>vrtest</title>
5-
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0, minimum-scale=1" />
5+
<meta charset="utf-8" />
6+
<meta name="viewport" content="minimum-scale=1, initial-scale=1, width=device-width" />
67
<style>body { background-color: white; }</style>
78
</head>
89
<body>
910
<script src="../../tmp/tests.js"></script>
1011
</body>
1112
</html>
13+
<!--
14+
15+
Load the page and run
16+
17+
__vrtest__.runBeforeHooks();
18+
__vrtest__.createTestController();
19+
__vrtest__.testController.start();
20+
__vrtest__.testController.next();
21+
22+
https://github.com/nathanmarks/vrtest/blob/e2240dc018d3392ca232712bb34aef7b80ee1000/src/server/runner.js#L94
23+
24+
-->

0 commit comments

Comments
 (0)