Skip to content
Merged
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
44 changes: 44 additions & 0 deletions app/tests/src/androidBuildGradle.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11

/**
* @jest-environment node
*/

import * as fs from 'fs';
import * as path from 'path';

describe('Android build.gradle Configuration', () => {
const gradlePath = path.join(__dirname, '../../android/app/build.gradle');
const rootGradlePath = path.join(__dirname, '../../android/build.gradle');
let gradleContent: string;
let rootGradleContent: string;

beforeAll(() => {
gradleContent = fs.readFileSync(gradlePath, 'utf8');
rootGradleContent = fs.readFileSync(rootGradlePath, 'utf8');
});

it('uses the correct applicationId and version', () => {
expect(gradleContent).toMatch(/applicationId\s+"com\.proofofpassportapp"/);
expect(gradleContent).toMatch(/versionName\s+"2.6.1"/);
expect(gradleContent).toMatch(/versionCode\s+82/);
});

it('references SDK versions from the root project', () => {
expect(gradleContent).toMatch(
/minSdkVersion\s+rootProject\.ext\.minSdkVersion/,
);
expect(gradleContent).toMatch(
/targetSdkVersion\s+rootProject\.ext\.targetSdkVersion/,
);
});

it('sets the expected SDK version numbers', () => {
expect(rootGradleContent).toMatch(/minSdkVersion\s*=\s*23/);
expect(rootGradleContent).toMatch(/targetSdkVersion\s*=\s*35/);
});

it('includes Firebase messaging dependency', () => {
expect(gradleContent).toContain('com.google.firebase:firebase-messaging');
});
});
33 changes: 33 additions & 0 deletions app/tests/src/iosInfoPlist.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11

/**
* @jest-environment node
*/

import * as fs from 'fs';
import * as path from 'path';

describe('iOS Info.plist Configuration', () => {
const plistPath = path.join(__dirname, '../../ios/OpenPassport/Info.plist');
let plistContent: string;

beforeAll(() => {
plistContent = fs.readFileSync(plistPath, 'utf8');
});

it('contains the proofofpassport URL scheme', () => {
const regex =
/<key>CFBundleURLSchemes<\/key>\s*<array>\s*<string>proofofpassport<\/string>/s;
expect(plistContent).toMatch(regex);
});

it('has NFC and camera usage descriptions', () => {
expect(plistContent).toContain('<key>NFCReaderUsageDescription</key>');
expect(plistContent).toContain('<key>NSCameraUsageDescription</key>');
});

it('lists required fonts', () => {
expect(plistContent).toContain('<string>Advercase-Regular.otf</string>');
expect(plistContent).toContain('<string>DINOT-Medium.otf</string>');
});
});
40 changes: 40 additions & 0 deletions app/tests/src/iosPbxproj.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11

/**
* @jest-environment node
*/

import * as fs from 'fs';
import * as path from 'path';

describe('iOS project.pbxproj Configuration', () => {
const projectPath = path.join(
__dirname,
'../../ios/Self.xcodeproj/project.pbxproj',
);
let projectContent: string;

beforeAll(() => {
try {
projectContent = fs.readFileSync(projectPath, 'utf8');
} catch (error) {
throw new Error(
`Failed to read iOS project file at ${projectPath}: ${error instanceof Error ? error.message : String(error)}`,
);
}
});

it('uses the correct bundle identifier', () => {
expect(projectContent).toMatch(
/PRODUCT_BUNDLE_IDENTIFIER\s*=\s*com\.warroom\.proofofpassport;/,
);
});

it('has the expected development team set', () => {
expect(projectContent).toMatch(/DEVELOPMENT_TEAM\s*=\s*5B29R5LYHQ;/);
});

it('includes GoogleService-Info.plist in resources', () => {
expect(projectContent).toContain('GoogleService-Info.plist in Resources');
});
});
Loading