Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Add fixtures for missing findings #398

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Fixture description:
// Async flag (rootView only, no routing) in manifest.json
// No manifest: "json" configuration in metadata
sap.ui.define(["sap/ui/core/UIComponent"], function (UIComponent) {
"use strict";

return UIComponent.extend("mycomp.Component");
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"_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",
"async": true
}
}
}
11 changes: 9 additions & 2 deletions test/fixtures/linter/rules/NoDeprecatedApi/NoDeprecatedApi.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sap.ui.define([
"sap/m/Button", "sap/m/DateTimeInput", "sap/base/util/includes", "sap/ui/Device", "sap/ui/core/library", "sap/ui/generic/app/navigation/service/NavigationHandler",
"sap/ui/table/Table", "sap/ui/table/plugins/MultiSelectionPlugin", "sap/ui/core/Configuration", "sap/m/library"
], function(Button, DateTimeInput, includes, Device, coreLib, NavigationHandler, Table, MultiSelectionPlugin, Configuration, mobileLib) {
"sap/ui/table/Table", "sap/ui/table/plugins/MultiSelectionPlugin", "sap/ui/core/Configuration", "sap/m/library", "sap/m/Bar"
], function(Button, DateTimeInput, includes, Device, coreLib, NavigationHandler, Table, MultiSelectionPlugin, Configuration, mobileLib, Bar) {

var dateTimeInput = new DateTimeInput(); // Control is deprecated. A finding only appears for the module dependency, not for the usage.

Expand Down Expand Up @@ -48,4 +48,11 @@ sap.ui.define([

const navigationHandler = new NavigationHandler({});
navigationHandler.storeInnerAppState({}); // Method "storeInnerAppState" is deprecated

var bar = new Bar("P1Header", {
enableFlexBox: false, // Property "enableFlexBox" is deprecated
contentLeft: [],
contentRight: []
})

});
8 changes: 8 additions & 0 deletions test/fixtures/linter/rules/renderer/9Control.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
sap.ui.define(["sap/m/Image", "sap/m/ImageRenderer"], function (Image, ImageRenderer) {
var LightBox = Image.extend("Lightbox", {
metadata: {},
renderer: ImageRenderer.render
});

return Lightbox;
});
Binary file modified test/lib/linter/rules/snapshots/AsyncComponentFlags.ts.snap
Binary file not shown.
8 changes: 8 additions & 0 deletions test/lib/linter/rules/snapshots/renderer.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,14 @@ Generated by [AVA](https://avajs.dev).
],
warningCount: 0,
},
{
coverageInfo: [],
errorCount: 0,
fatalErrorCount: 0,
filePath: '9Control.js',
messages: [],
warningCount: 0,
},
{
coverageInfo: [],
errorCount: 3,
Expand Down
Binary file modified test/lib/linter/rules/snapshots/renderer.ts.snap
Binary file not shown.