-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e3754a3
commit 031fda6
Showing
21 changed files
with
192 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,94 +1,94 @@ | ||
const env = process.env | ||
const env = process.env; | ||
|
||
describe('Properties File Tests', () => { | ||
it('should have EXPO_PUBLIC_BACKEND_URL defined', () => { | ||
expect(env.EXPO_PUBLIC_BACKEND_URL).toBeDefined(); | ||
}); | ||
it('should have EXPO_PUBLIC_BACKEND_URL defined', () => { | ||
expect(env.EXPO_PUBLIC_BACKEND_URL).toBeDefined(); | ||
}); | ||
|
||
it('should have EXPO_PUBLIC_STRIPE_PAYMENT_URL defined', () => { | ||
expect(env.EXPO_PUBLIC_STRIPE_PAYMENT_URL).toBeDefined(); | ||
}); | ||
it('should have EXPO_PUBLIC_STRIPE_PAYMENT_URL defined', () => { | ||
expect(env.EXPO_PUBLIC_STRIPE_PAYMENT_URL).toBeDefined(); | ||
}); | ||
|
||
it('should have EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY defined', () => { | ||
expect(env.EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY).toBeDefined(); | ||
}); | ||
it('should have EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY defined', () => { | ||
expect(env.EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY).toBeDefined(); | ||
}); | ||
|
||
it('should have EXPO_PUBLIC_PRODUCTS_ENDPOINT defined', () => { | ||
expect(env.EXPO_PUBLIC_PRODUCTS_ENDPOINT).toBeDefined(); | ||
}); | ||
it('should have EXPO_PUBLIC_PRODUCTS_ENDPOINT defined', () => { | ||
expect(env.EXPO_PUBLIC_PRODUCTS_ENDPOINT).toBeDefined(); | ||
}); | ||
|
||
it('should have EXPO_PUBLIC_TAGS_ENDPOINT defined', () => { | ||
expect(env.EXPO_PUBLIC_TAGS_ENDPOINT).toBeDefined(); | ||
}); | ||
it('should have EXPO_PUBLIC_TAGS_ENDPOINT defined', () => { | ||
expect(env.EXPO_PUBLIC_TAGS_ENDPOINT).toBeDefined(); | ||
}); | ||
|
||
it('should have EXPO_PUBLIC_CATEGORIES_ENDPOINT defined', () => { | ||
expect(env.EXPO_PUBLIC_CATEGORIES_ENDPOINT).toBeDefined(); | ||
}); | ||
it('should have EXPO_PUBLIC_CATEGORIES_ENDPOINT defined', () => { | ||
expect(env.EXPO_PUBLIC_CATEGORIES_ENDPOINT).toBeDefined(); | ||
}); | ||
|
||
it('should have EXPO_PUBLIC_VIDEO_PREVIEW_URL defined', () => { | ||
expect(env.EXPO_PUBLIC_VIDEO_PREVIEW_URL).toBeDefined(); | ||
}); | ||
it('should have EXPO_PUBLIC_VIDEO_PREVIEW_URL defined', () => { | ||
expect(env.EXPO_PUBLIC_VIDEO_PREVIEW_URL).toBeDefined(); | ||
}); | ||
|
||
it('should have EXPO_PUBLIC_RATE_APP_URL_ANDROID defined', () => { | ||
expect(env.EXPO_PUBLIC_RATE_APP_URL_ANDROID).toBeDefined(); | ||
}); | ||
it('should have EXPO_PUBLIC_RATE_APP_URL_ANDROID defined', () => { | ||
expect(env.EXPO_PUBLIC_RATE_APP_URL_ANDROID).toBeDefined(); | ||
}); | ||
|
||
it('should have EXPO_PUBLIC_RATE_APP_URL_IOS defined', () => { | ||
expect(env.EXPO_PUBLIC_RATE_APP_URL_IOS).toBeDefined(); | ||
}); | ||
it('should have EXPO_PUBLIC_RATE_APP_URL_IOS defined', () => { | ||
expect(env.EXPO_PUBLIC_RATE_APP_URL_IOS).toBeDefined(); | ||
}); | ||
|
||
it('should have EXPO_PUBLIC_CONTACT_URL defined', () => { | ||
expect(env.EXPO_PUBLIC_CONTACT_URL).toBeDefined(); | ||
}); | ||
it('should have EXPO_PUBLIC_CONTACT_URL defined', () => { | ||
expect(env.EXPO_PUBLIC_CONTACT_URL).toBeDefined(); | ||
}); | ||
|
||
it('should have EXPO_PUBLIC_TERMS_URL defined', () => { | ||
expect(env.EXPO_PUBLIC_TERMS_URL).toBeDefined(); | ||
}); | ||
it('should have EXPO_PUBLIC_TERMS_URL defined', () => { | ||
expect(env.EXPO_PUBLIC_TERMS_URL).toBeDefined(); | ||
}); | ||
|
||
it('should have EXPO_PUBLIC_PRIVACY_URL defined', () => { | ||
expect(env.EXPO_PUBLIC_PRIVACY_URL).toBeDefined(); | ||
}); | ||
it('should have EXPO_PUBLIC_PRIVACY_URL defined', () => { | ||
expect(env.EXPO_PUBLIC_PRIVACY_URL).toBeDefined(); | ||
}); | ||
|
||
it('should have EXPO_PUBLIC_ABOUT_URL defined', () => { | ||
expect(env.EXPO_PUBLIC_ABOUT_URL).toBeDefined(); | ||
}); | ||
it('should have EXPO_PUBLIC_ABOUT_URL defined', () => { | ||
expect(env.EXPO_PUBLIC_ABOUT_URL).toBeDefined(); | ||
}); | ||
}); | ||
|
||
describe('Integration Tests', () => { | ||
test('Products Endpoint', async () => { | ||
if(!env.EXPO_PUBLIC_BACKEND_URL?.includes('10.0.2.2')) { | ||
const response = await fetch(env.EXPO_PUBLIC_BACKEND_URL || ''); | ||
expect(response.status).toBe(200); | ||
} | ||
}); | ||
|
||
test('Payments Endpoint', async () => { | ||
const response = await fetch(env.EXPO_PUBLIC_STRIPE_PAYMENT_URL!); | ||
expect(response.status).toBe(200); | ||
// Add more assertions for the response data if needed | ||
}); | ||
|
||
test('Video Preview Endpoint', async () => { | ||
const response = await fetch(env.EXPO_PUBLIC_VIDEO_PREVIEW_URL!); | ||
expect(response.status).toBe(200); | ||
// Add more assertions for the response data if needed | ||
}); | ||
|
||
test('Terms URL', async () => { | ||
const response = await fetch(env.EXPO_PUBLIC_TERMS_URL!); | ||
expect([200,410]).toContain(response.status); | ||
// Add more assertions for the response data if needed | ||
}); | ||
|
||
test('Privacy URL', async () => { | ||
const response = await fetch(env.EXPO_PUBLIC_PRIVACY_URL!); | ||
expect([200,410]).toContain(response.status); | ||
// Add more assertions for the response data if needed | ||
}); | ||
|
||
test('About URL', async () => { | ||
const response = await fetch(env.EXPO_PUBLIC_ABOUT_URL!); | ||
expect([200,410]).toContain(response.status); | ||
// Add more assertions for the response data if needed | ||
}); | ||
}); | ||
test('Products Endpoint', async () => { | ||
if (!env.EXPO_PUBLIC_BACKEND_URL?.includes('10.0.2.2')) { | ||
const response = await fetch(env.EXPO_PUBLIC_BACKEND_URL || ''); | ||
expect(response.status).toBe(200); | ||
} | ||
}); | ||
|
||
test('Payments Endpoint', async () => { | ||
const response = await fetch(env.EXPO_PUBLIC_STRIPE_PAYMENT_URL!); | ||
expect(response.status).toBe(200); | ||
// Add more assertions for the response data if needed | ||
}); | ||
|
||
test('Video Preview Endpoint', async () => { | ||
const response = await fetch(env.EXPO_PUBLIC_VIDEO_PREVIEW_URL!); | ||
expect(response.status).toBe(200); | ||
// Add more assertions for the response data if needed | ||
}); | ||
|
||
test('Terms URL', async () => { | ||
const response = await fetch(env.EXPO_PUBLIC_TERMS_URL!); | ||
expect([200, 410]).toContain(response.status); | ||
// Add more assertions for the response data if needed | ||
}); | ||
|
||
test('Privacy URL', async () => { | ||
const response = await fetch(env.EXPO_PUBLIC_PRIVACY_URL!); | ||
expect([200, 410]).toContain(response.status); | ||
// Add more assertions for the response data if needed | ||
}); | ||
|
||
test('About URL', async () => { | ||
const response = await fetch(env.EXPO_PUBLIC_ABOUT_URL!); | ||
expect([200, 410]).toContain(response.status); | ||
// Add more assertions for the response data if needed | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export default { | ||
WHITESPACE_CHARACTER: ' ', | ||
MANDATORY_CHARACTER: '*', | ||
} | ||
WHITESPACE_CHARACTER: ' ', | ||
MANDATORY_CHARACTER: '*', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import { SupportedLanguage } from "@models/Languages"; | ||
import { SupportedLanguage } from '@models/Languages'; | ||
|
||
const SUPPORTED_LANGUAGES: SupportedLanguage[] = [ | ||
{ | ||
name: "English", | ||
code: "en", | ||
flagIsoCode: "GB", | ||
}, | ||
{ | ||
name: "Romana", | ||
code: "ro", | ||
flagIsoCode: "RO", | ||
}, | ||
{ | ||
name: 'English', | ||
code: 'en', | ||
flagIsoCode: 'GB', | ||
}, | ||
{ | ||
name: 'Romana', | ||
code: 'ro', | ||
flagIsoCode: 'RO', | ||
}, | ||
]; | ||
|
||
export default SUPPORTED_LANGUAGES; | ||
export default SUPPORTED_LANGUAGES; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
import AsyncStorage from '@react-native-async-storage/async-storage'; | ||
|
||
export default function formatDateByLocale(date: Date): Promise<string> { | ||
return AsyncStorage.getItem('user-language').then((language) => | ||
date.toLocaleDateString(language || 'en', { | ||
year: 'numeric', | ||
month: 'long', | ||
day: 'numeric', | ||
}).toLocaleUpperCase()); | ||
return AsyncStorage.getItem('user-language').then((language) => | ||
date | ||
.toLocaleDateString(language || 'en', { | ||
year: 'numeric', | ||
month: 'long', | ||
day: 'numeric', | ||
}) | ||
.toLocaleUpperCase(), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.