Skip to content

Commit

Permalink
Added unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaskatz96 authored Nov 4, 2024
1 parent 4bc3962 commit 0144a9f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/unit/helper-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
getAndroidPlatformAndPath,
buildStartCmd, isShowingLockscreen, getBuildToolsDirs,
parseAaptStrings, parseAapt2Strings,
extractMatchingPermissions, parseLaunchableActivityNames,
extractMatchingPermissions, parseLaunchableActivityNames, matchComponentName,
} from '../../lib/helpers';
import { withMocks } from '@appium/test-support';
import { fs } from '@appium/support';
Expand Down Expand Up @@ -472,4 +472,16 @@ describe('helpers', withMocks({fs}, function (mocks) {
names.should.be.eql([]);
});
});
describe('matchComponentName', function () {
it('test valid activity name', function () {
const activity = "ןذأצЮυπиС.נפשוקשΤπΟ.ЦοКسئοهΦΦ";

Check failure on line 477 in test/unit/helper-specs.js

View workflow job for this annotation

GitHub Actions / test (20)

Strings must use singlequote
const names = matchComponentName(activity);
names.should.eql(["ןذأצЮυπиС.נפשוקשΤπΟ.ЦοКسئοهΦΦ"]);

Check failure on line 479 in test/unit/helper-specs.js

View workflow job for this annotation

GitHub Actions / test (20)

Strings must use singlequote
});
it('test invalid activity name', function () {
const activity = "User@123";

Check failure on line 482 in test/unit/helper-specs.js

View workflow job for this annotation

GitHub Actions / test (20)

Strings must use singlequote
const result = String(matchComponentName(activity));
result.should.be.eql('null');
});
});
}));

0 comments on commit 0144a9f

Please sign in to comment.