Skip to content

Commit

Permalink
feat: Add test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
d3xter666 committed Mar 26, 2024
1 parent a3edbc5 commit 69cb23a
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
39 changes: 39 additions & 0 deletions test/fixtures/linter/rules/NoDeprecatedApi/NoInlineJS.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<html>

<head>
<title>No inline JS</title>
</head>

<body>
<script type="text/javascript">
sap.ui.controller("my.own.controller", {
doSomething: function () {
alert("Hello World!");
}
});
</script>

<script type="">
(function() {
alert("test")
})();
</script>

<script>
sap.ui.controller("myController", {
onInit: function () {
var model = new sap.ui.model.json.JSONModel();
model.setData({
buttonText: "Click Me!"
});
this.getView().setModel(model);
},
doSomething: function () {
alert("Hello World!");
}
});
sap.ui.xmlview({ viewContent: jQuery('#myXml').html() }).placeAt("content");
</script>
</body>

</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<html>

<head>
<title>No inline JS</title>
</head>

<body>
<script id="myXml" type="text/xmldata">
<mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" controllerName="myController" displayBlock="true">
<App>
<Page title="Hello">
<Button text="{/buttonText}" press= "doSomething"/>
</Page>
</App>
</mvc:View>
</script>

<script type="" src="./path/to/js.js"></script>

<script src="./another/path/to/js.js"></script>
</body>

</html>

0 comments on commit 69cb23a

Please sign in to comment.