From d60a47e96320c1c767488f9592d24e4b0d6215cd Mon Sep 17 00:00:00 2001 From: Yavor Ivanov Date: Tue, 7 May 2024 16:13:21 +0300 Subject: [PATCH] test: Checks for inheritance in ES6 components --- .../BestPractices/Negative_7/Component.js | 9 ++++ .../BestPractices/Negative_7/manifest.json | 45 ++++++++++++++++++ .../rules/snapshots/BestPractices.ts.md | 15 ++++++ .../rules/snapshots/BestPractices.ts.snap | Bin 1446 -> 1454 bytes 4 files changed, 69 insertions(+) create mode 100644 test/fixtures/linter/rules/BestPractices/Negative_7/Component.js create mode 100644 test/fixtures/linter/rules/BestPractices/Negative_7/manifest.json diff --git a/test/fixtures/linter/rules/BestPractices/Negative_7/Component.js b/test/fixtures/linter/rules/BestPractices/Negative_7/Component.js new file mode 100644 index 000000000..110f10e4a --- /dev/null +++ b/test/fixtures/linter/rules/BestPractices/Negative_7/Component.js @@ -0,0 +1,9 @@ +sap.ui.define(["sap/fe/core/AppComponent"], function (AppComponent) { + "use strict"; + + return AppComponent.extend("mycomp.Component", { + metadata: { + manifest: "json", + }, + }); +}); diff --git a/test/fixtures/linter/rules/BestPractices/Negative_7/manifest.json b/test/fixtures/linter/rules/BestPractices/Negative_7/manifest.json new file mode 100644 index 000000000..63a4fffc3 --- /dev/null +++ b/test/fixtures/linter/rules/BestPractices/Negative_7/manifest.json @@ -0,0 +1,45 @@ +{ + "_version": "1.12.0", + + "sap.app": { + "id": "mycomp", + "type": "application", + "i18n": "i18n/i18n.properties", + "title": "{{appTitle}}", + "description": "{{appDescription}}", + "applicationVersion": { + "version": "1.0.0" + } + }, + + "sap.ui5": { + "rootView": { + "viewName": "mycomp.view.App", + "type": "XML", + "id": "app" + }, + + "routing": { + "config": { + "routerClass": "sap.m.routing.Router", + "viewType": "XML", + "viewPath": "mycomp.view", + "controlId": "app", + "controlAggregation": "pages" + }, + "routes": [ + { + "pattern": "", + "name": "main", + "target": "main" + } + ], + "targets": { + "main": { + "viewId": "main", + "viewName": "Main" + } + } + } + } +} diff --git a/test/lib/linter/rules/snapshots/BestPractices.ts.md b/test/lib/linter/rules/snapshots/BestPractices.ts.md index 6fd4ab49e..4c2b06296 100644 --- a/test/lib/linter/rules/snapshots/BestPractices.ts.md +++ b/test/lib/linter/rules/snapshots/BestPractices.ts.md @@ -110,6 +110,21 @@ Generated by [AVA](https://avajs.dev). }, ] +## General: Negative_7/Component.js + +> Snapshot 1 + + [ + { + coverageInfo: [], + errorCount: 0, + fatalErrorCount: 0, + filePath: 'Negative_7/Component.js', + messages: [], + warningCount: 0, + }, + ] + ## General: Positive_1/Component.js > Snapshot 1 diff --git a/test/lib/linter/rules/snapshots/BestPractices.ts.snap b/test/lib/linter/rules/snapshots/BestPractices.ts.snap index 78358ed40de02d0df65d2c1d115f9b867f9110c2..60f46b8e72affbf8986d465f9357226dc1f06b56 100644 GIT binary patch delta 1443 zcmV;U1zh^33$6=)K~_N^Q*L2!b7*gLAa*kf0|53yZ@``noDG9gv@i;1Ql<|SWR5BV z;Q5OZPg?4q!m1yO2mk;800003?OIK28$}fU-mcen+q7vZC{hv9s0g(ciCrg-Q>q?X zwWvyqpsK`Axm08C*x9h2v3AD^Ie=7zfJ=o$xgb*Br*^5Fu+7+*}qe2RgyZhPm zqQwr{>pQ;W4Sz;y|I7v3=9-_P_f2FF{85&SQ2^rrwo`f=S%*B2 zFA%k_hKGlLK^s8?+C+4q-6=B<;0*vD1Na8OZvb`>P^8vC=@-hgqN2%Iy4<>TD`+z) z4cbEVG69d039`1)P({rNkJrSstSZnjwv*9r+bBFwd52X~>hMttkr#%mTyyu?n76W3 z#}y~Io@qZA>48?bIKN|Y*}Cw3UK4&~#G!faNk`Uyx+l$c!Dx2D*xi=uXzRn}c*5l> zxEx>CTuvlhu7b;nboEkS1W1fLQ|Gj-fV7na>FLl7Jrx_?v)74B(gn*hZwQ)#FsWYYg^OJkf#s z3GNAhsqZ)&myETZjip_FH{e~4^f+DN;(l54{?>N(qiyLvZJCv6rj%%AAet#X6q+gh zFEulj#0;xA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