Skip to content

Commit

Permalink
test: Add NavigationHandler fixture of deprecated API usage
Browse files Browse the repository at this point in the history
  • Loading branch information
matz3 committed Mar 22, 2024
1 parent 5bf1185 commit f4a370e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
7 changes: 5 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/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, Table, MultiSelectionPlugin, Configuration, mobileLib) {
], function(Button, DateTimeInput, includes, Device, coreLib, NavigationHandler, Table, MultiSelectionPlugin, Configuration, mobileLib) {

var dateTimeInput = new DateTimeInput(); // TODO detect: Control is deprecated

Expand Down Expand Up @@ -34,4 +34,7 @@ sap.ui.define([
coreLib.MessageType; // Enum "MessageType" is deprecated

mobileLib.InputType.Date; // Enum value "InputType.Date" is deprecated

const navigationHandler = new NavigationHandler();
navigationHandler.storeInnerAppState({}); // Method "storeInnerAppState" is deprecated
});
20 changes: 19 additions & 1 deletion test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Generated by [AVA](https://avajs.dev).
[
{
coverageInfo: [],
errorCount: 15,
errorCount: 17,
fatalErrorCount: 0,
filePath: 'NoDeprecatedApi.js',
messages: [
Expand All @@ -58,6 +58,15 @@ Generated by [AVA](https://avajs.dev).
ruleId: 'ui5-linter-no-deprecated-api',
severity: 2,
},
{
column: 107,
fatal: undefined,
line: 2,
message: 'Import of deprecated module \'sap/ui/generic/app/navigation/service/NavigationHandler\'',
messageDetails: 'Deprecated test message',
ruleId: 'ui5-linter-no-deprecated-api',
severity: 2,
},
{
column: 3,
fatal: undefined,
Expand Down Expand Up @@ -175,6 +184,15 @@ Generated by [AVA](https://avajs.dev).
ruleId: 'ui5-linter-no-deprecated-property',
severity: 2,
},
{
column: 2,
fatal: undefined,
line: 39,
message: 'Call to deprecated function \'storeInnerAppState\' of class \'NavigationHandler\'',
messageDetails: 'Deprecated test message',
ruleId: 'ui5-linter-no-deprecated-api',
severity: 2,
},
],
warningCount: 0,
},
Expand Down
Binary file modified test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.snap
Binary file not shown.

0 comments on commit f4a370e

Please sign in to comment.