Skip to content

Commit 8636c67

Browse files
committed
remove more redundant tests
1 parent 90fbd8a commit 8636c67

File tree

1 file changed

+0
-220
lines changed

1 file changed

+0
-220
lines changed

packages/babel-plugin-component-annotate/test/test-plugin.test.ts

Lines changed: 0 additions & 220 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,226 +1305,6 @@ it("Bananas ignore components dataSentrySourceFile=* dataSentryComponent=* dataS
13051305
`);
13061306
});
13071307

1308-
it("Bananas/Pizza/App No Bananas Elements dataSentrySourceFile=match dataSentryComponent=match dataSentryElement=match snapshot matches", () => {
1309-
const result = transform(BananasPizzaAppStandardInput, {
1310-
filename: "/filename-test.js",
1311-
configFile: false,
1312-
presets: ["@babel/preset-react"],
1313-
plugins: [
1314-
[
1315-
plugin,
1316-
{
1317-
native: true,
1318-
ignoreComponents: [
1319-
// Bananas Element
1320-
["filename-test.js", null, "Bananas"],
1321-
],
1322-
},
1323-
],
1324-
],
1325-
});
1326-
1327-
expect(result?.code).toMatchInlineSnapshot(`
1328-
"import React, { Component } from 'react';
1329-
import { StyleSheet, Text, TextInput, View, Image, UIManager } from 'react-native';
1330-
UIManager.getViewManagerConfig('RCTView').NativeProps.fsClass = \\"String\\";
1331-
class Bananas extends Component {
1332-
render() {
1333-
let pic = {
1334-
uri: 'https://upload.wikimedia.org/wikipedia/commons/d/de/Bananavarieties.jpg'
1335-
};
1336-
return /*#__PURE__*/React.createElement(Image, {
1337-
source: pic,
1338-
style: {
1339-
width: 193,
1340-
height: 110,
1341-
marginTop: 10
1342-
},
1343-
fsClass: \\"test-class\\",
1344-
dataSentryElement: \\"Image\\",
1345-
dataSentryComponent: \\"Bananas\\",
1346-
dataSentrySourceFile: \\"filename-test.js\\"
1347-
});
1348-
}
1349-
}
1350-
class PizzaTranslator extends Component {
1351-
constructor(props) {
1352-
super(props);
1353-
this.state = {
1354-
text: ''
1355-
};
1356-
}
1357-
render() {
1358-
return /*#__PURE__*/React.createElement(View, {
1359-
style: {
1360-
padding: 10
1361-
},
1362-
dataSentryElement: \\"View\\",
1363-
dataSentryComponent: \\"PizzaTranslator\\",
1364-
dataSentrySourceFile: \\"filename-test.js\\"
1365-
}, /*#__PURE__*/React.createElement(TextInput, {
1366-
style: {
1367-
backgroundColor: '#000',
1368-
color: '#eee',
1369-
padding: 8
1370-
},
1371-
placeholder: \\"Type here to translate!\\" // not supported on iOS
1372-
,
1373-
onChangeText: text => this.setState({
1374-
text
1375-
}),
1376-
value: this.state.text,
1377-
dataSentryElement: \\"TextInput\\",
1378-
dataSentrySourceFile: \\"filename-test.js\\"
1379-
}), /*#__PURE__*/React.createElement(Text, {
1380-
style: {
1381-
padding: 10,
1382-
fontSize: 42
1383-
},
1384-
dataSentryElement: \\"Text\\",
1385-
dataSentrySourceFile: \\"filename-test.js\\"
1386-
}, this.state.text.split(' ').map(word => word && '🍕').join(' ')));
1387-
}
1388-
}
1389-
export default function App() {
1390-
return /*#__PURE__*/React.createElement(View, {
1391-
style: styles.container,
1392-
dataSentryElement: \\"View\\",
1393-
dataSentryComponent: \\"App\\",
1394-
dataSentrySourceFile: \\"filename-test.js\\"
1395-
}, /*#__PURE__*/React.createElement(Text, {
1396-
style: {
1397-
color: '#eee'
1398-
},
1399-
dataSentryElement: \\"Text\\",
1400-
dataSentrySourceFile: \\"filename-test.js\\"
1401-
}, \\"FullStory ReactNative testing app\\"), /*#__PURE__*/React.createElement(Bananas, null), /*#__PURE__*/React.createElement(PizzaTranslator, {
1402-
dataSentryElement: \\"PizzaTranslator\\",
1403-
dataSentrySourceFile: \\"filename-test.js\\"
1404-
}));
1405-
}
1406-
const styles = StyleSheet.create({
1407-
container: {
1408-
flex: 1,
1409-
justifyContent: 'center',
1410-
alignItems: 'stretch',
1411-
backgroundColor: '#222',
1412-
alignItems: 'center',
1413-
justifyContent: 'center'
1414-
}
1415-
});"
1416-
`);
1417-
});
1418-
1419-
it("Bananas/Pizza/App No Bananas/Pizza Elements dataSentrySourceFile=match dataSentryComponent=match dataSentryElement=match snapshot matches", () => {
1420-
const result = transform(BananasPizzaAppStandardInput, {
1421-
filename: "/filename-test.js",
1422-
configFile: false,
1423-
presets: ["@babel/preset-react"],
1424-
plugins: [
1425-
[
1426-
plugin,
1427-
{
1428-
native: true,
1429-
ignoreComponents: [
1430-
// Bananas Element
1431-
["filename-test.js", null, "Bananas"],
1432-
// Pizza Element
1433-
["filename-test.js", null, "PizzaTranslator"],
1434-
],
1435-
},
1436-
],
1437-
],
1438-
});
1439-
expect(result?.code).toMatchInlineSnapshot(`
1440-
"import React, { Component } from 'react';
1441-
import { StyleSheet, Text, TextInput, View, Image, UIManager } from 'react-native';
1442-
UIManager.getViewManagerConfig('RCTView').NativeProps.fsClass = \\"String\\";
1443-
class Bananas extends Component {
1444-
render() {
1445-
let pic = {
1446-
uri: 'https://upload.wikimedia.org/wikipedia/commons/d/de/Bananavarieties.jpg'
1447-
};
1448-
return /*#__PURE__*/React.createElement(Image, {
1449-
source: pic,
1450-
style: {
1451-
width: 193,
1452-
height: 110,
1453-
marginTop: 10
1454-
},
1455-
fsClass: \\"test-class\\",
1456-
dataSentryElement: \\"Image\\",
1457-
dataSentryComponent: \\"Bananas\\",
1458-
dataSentrySourceFile: \\"filename-test.js\\"
1459-
});
1460-
}
1461-
}
1462-
class PizzaTranslator extends Component {
1463-
constructor(props) {
1464-
super(props);
1465-
this.state = {
1466-
text: ''
1467-
};
1468-
}
1469-
render() {
1470-
return /*#__PURE__*/React.createElement(View, {
1471-
style: {
1472-
padding: 10
1473-
},
1474-
dataSentryElement: \\"View\\",
1475-
dataSentryComponent: \\"PizzaTranslator\\",
1476-
dataSentrySourceFile: \\"filename-test.js\\"
1477-
}, /*#__PURE__*/React.createElement(TextInput, {
1478-
style: {
1479-
backgroundColor: '#000',
1480-
color: '#eee',
1481-
padding: 8
1482-
},
1483-
placeholder: \\"Type here to translate!\\" // not supported on iOS
1484-
,
1485-
onChangeText: text => this.setState({
1486-
text
1487-
}),
1488-
value: this.state.text,
1489-
dataSentryElement: \\"TextInput\\",
1490-
dataSentrySourceFile: \\"filename-test.js\\"
1491-
}), /*#__PURE__*/React.createElement(Text, {
1492-
style: {
1493-
padding: 10,
1494-
fontSize: 42
1495-
},
1496-
dataSentryElement: \\"Text\\",
1497-
dataSentrySourceFile: \\"filename-test.js\\"
1498-
}, this.state.text.split(' ').map(word => word && '🍕').join(' ')));
1499-
}
1500-
}
1501-
export default function App() {
1502-
return /*#__PURE__*/React.createElement(View, {
1503-
style: styles.container,
1504-
dataSentryElement: \\"View\\",
1505-
dataSentryComponent: \\"App\\",
1506-
dataSentrySourceFile: \\"filename-test.js\\"
1507-
}, /*#__PURE__*/React.createElement(Text, {
1508-
style: {
1509-
color: '#eee'
1510-
},
1511-
dataSentryElement: \\"Text\\",
1512-
dataSentrySourceFile: \\"filename-test.js\\"
1513-
}, \\"FullStory ReactNative testing app\\"), /*#__PURE__*/React.createElement(Bananas, null), /*#__PURE__*/React.createElement(PizzaTranslator, null));
1514-
}
1515-
const styles = StyleSheet.create({
1516-
container: {
1517-
flex: 1,
1518-
justifyContent: 'center',
1519-
alignItems: 'stretch',
1520-
backgroundColor: '#222',
1521-
alignItems: 'center',
1522-
justifyContent: 'center'
1523-
}
1524-
});"
1525-
`);
1526-
});
1527-
15281308
it("Bananas incompatible plugin @react-navigation source snapshot matches", () => {
15291309
const result = transform(BananasStandardInput, {
15301310
filename: "test/node_modules/@react-navigation/core/filename-test.js",

0 commit comments

Comments
 (0)