mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-04-30 03:27:55 +00:00
fix: Remove workspace config, fix test suite, update snapshots
- Remove root /home/mamostehp/package.json workspace config - Each project now independent (aligned with CI workflow) - Add SafeAreaProvider mock to jest setup - Add __DEV__ global for React Native tests - Update 4 snapshots for SafeAreaView changes - All 29 test suites pass (122 tests)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`BeCitizenScreen should match snapshot 1`] = `
|
||||
<RCTSafeAreaView
|
||||
<View
|
||||
style={
|
||||
{
|
||||
"backgroundColor": "#FFFFFF",
|
||||
@@ -12,94 +12,86 @@ exports[`BeCitizenScreen should match snapshot 1`] = `
|
||||
<View
|
||||
style={
|
||||
{
|
||||
"alignItems": "center",
|
||||
"backgroundColor": "#FFFFFF",
|
||||
"flex": 1,
|
||||
"borderBottomColor": "#E0E0E0",
|
||||
"borderBottomWidth": 1,
|
||||
"flexDirection": "row",
|
||||
"justifyContent": "space-between",
|
||||
"paddingHorizontal": 16,
|
||||
"paddingVertical": 12,
|
||||
}
|
||||
}
|
||||
>
|
||||
<View
|
||||
<Text
|
||||
style={
|
||||
{
|
||||
"alignItems": "center",
|
||||
"backgroundColor": "#FFFFFF",
|
||||
"borderBottomColor": "#E0E0E0",
|
||||
"borderBottomWidth": 1,
|
||||
"flexDirection": "row",
|
||||
"justifyContent": "space-between",
|
||||
"paddingHorizontal": 16,
|
||||
"paddingVertical": 12,
|
||||
"color": "#000",
|
||||
"flex": 1,
|
||||
"fontSize": 18,
|
||||
"fontWeight": "700",
|
||||
"textAlign": "center",
|
||||
}
|
||||
}
|
||||
>
|
||||
Be Citizen
|
||||
</Text>
|
||||
<View
|
||||
accessibilityState={
|
||||
{
|
||||
"busy": undefined,
|
||||
"checked": undefined,
|
||||
"disabled": undefined,
|
||||
"expanded": undefined,
|
||||
"selected": undefined,
|
||||
}
|
||||
}
|
||||
accessibilityValue={
|
||||
{
|
||||
"max": undefined,
|
||||
"min": undefined,
|
||||
"now": undefined,
|
||||
"text": undefined,
|
||||
}
|
||||
}
|
||||
accessible={true}
|
||||
collapsable={false}
|
||||
focusable={true}
|
||||
onClick={[Function]}
|
||||
onResponderGrant={[Function]}
|
||||
onResponderMove={[Function]}
|
||||
onResponderRelease={[Function]}
|
||||
onResponderTerminate={[Function]}
|
||||
onResponderTerminationRequest={[Function]}
|
||||
onStartShouldSetResponder={[Function]}
|
||||
style={
|
||||
{
|
||||
"opacity": 1,
|
||||
"padding": 8,
|
||||
}
|
||||
}
|
||||
>
|
||||
<Text
|
||||
style={
|
||||
{
|
||||
"color": "#000",
|
||||
"flex": 1,
|
||||
"fontSize": 18,
|
||||
"fontWeight": "700",
|
||||
"textAlign": "center",
|
||||
"color": "#00A94F",
|
||||
"fontSize": 14,
|
||||
"fontWeight": "600",
|
||||
}
|
||||
}
|
||||
>
|
||||
Be Citizen
|
||||
Reload
|
||||
</Text>
|
||||
<View
|
||||
accessibilityState={
|
||||
{
|
||||
"busy": undefined,
|
||||
"checked": undefined,
|
||||
"disabled": undefined,
|
||||
"expanded": undefined,
|
||||
"selected": undefined,
|
||||
}
|
||||
}
|
||||
accessibilityValue={
|
||||
{
|
||||
"max": undefined,
|
||||
"min": undefined,
|
||||
"now": undefined,
|
||||
"text": undefined,
|
||||
}
|
||||
}
|
||||
accessible={true}
|
||||
collapsable={false}
|
||||
focusable={true}
|
||||
onClick={[Function]}
|
||||
onResponderGrant={[Function]}
|
||||
onResponderMove={[Function]}
|
||||
onResponderRelease={[Function]}
|
||||
onResponderTerminate={[Function]}
|
||||
onResponderTerminationRequest={[Function]}
|
||||
onStartShouldSetResponder={[Function]}
|
||||
style={
|
||||
{
|
||||
"opacity": 1,
|
||||
"padding": 8,
|
||||
}
|
||||
}
|
||||
>
|
||||
<Text
|
||||
style={
|
||||
{
|
||||
"color": "#00A94F",
|
||||
"fontSize": 14,
|
||||
"fontWeight": "600",
|
||||
}
|
||||
}
|
||||
>
|
||||
Reload
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
<WebView
|
||||
allowsBackForwardNavigationGestures={true}
|
||||
allowsInlineMediaPlayback={true}
|
||||
bounces={true}
|
||||
cacheEnabled={true}
|
||||
cacheMode="LOAD_DEFAULT"
|
||||
domStorageEnabled={true}
|
||||
injectedJavaScript="
|
||||
</View>
|
||||
<WebView
|
||||
allowsBackForwardNavigationGestures={true}
|
||||
allowsInlineMediaPlayback={true}
|
||||
bounces={true}
|
||||
cacheEnabled={true}
|
||||
cacheMode="LOAD_DEFAULT"
|
||||
domStorageEnabled={true}
|
||||
injectedJavaScript="
|
||||
(function() {
|
||||
// Mark this as mobile app
|
||||
window.PEZKUWI_MOBILE = true;
|
||||
@@ -109,6 +101,36 @@ exports[`BeCitizenScreen should match snapshot 1`] = `
|
||||
window.PEZKUWI_ADDRESS = '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY';
|
||||
window.PEZKUWI_ACCOUNT_NAME = 'Mobile Wallet';
|
||||
|
||||
// Inject auth session for automatic login
|
||||
|
||||
|
||||
window.PEZKUWI_USER_ID = 'test-user-id';
|
||||
window.PEZKUWI_USER_EMAIL = 'test@pezkuwichain.io';
|
||||
|
||||
// Auto-authenticate with Supabase if session token exists
|
||||
if (window.PEZKUWI_SESSION_TOKEN) {
|
||||
(function autoAuth(attempts = 0) {
|
||||
if (attempts > 50) {
|
||||
console.warn('[Mobile] Auto-auth timed out: window.supabase not found');
|
||||
return;
|
||||
}
|
||||
|
||||
if (window.supabase && window.supabase.auth) {
|
||||
window.supabase.auth.setSession({
|
||||
access_token: window.PEZKUWI_SESSION_TOKEN,
|
||||
refresh_token: window.PEZKUWI_REFRESH_TOKEN || ''
|
||||
}).then(function(res) {
|
||||
if (res.error) console.warn('[Mobile] Auto-auth error:', res.error);
|
||||
else console.log('[Mobile] Auto-authenticated successfully');
|
||||
}).catch(function(err) {
|
||||
console.warn('[Mobile] Auto-auth promise failed:', err);
|
||||
});
|
||||
} else {
|
||||
setTimeout(function() { autoAuth(attempts + 1); }, 100);
|
||||
}
|
||||
})(0);
|
||||
}
|
||||
|
||||
// Override console.log to send to React Native (for debugging)
|
||||
const originalConsoleLog = console.log;
|
||||
console.log = function(...args) {
|
||||
@@ -166,66 +188,65 @@ exports[`BeCitizenScreen should match snapshot 1`] = `
|
||||
true; // Required for injectedJavaScript
|
||||
})();
|
||||
"
|
||||
javaScriptEnabled={true}
|
||||
mediaPlaybackRequiresUserAction={false}
|
||||
onError={[Function]}
|
||||
onHttpError={[Function]}
|
||||
onLoadEnd={[Function]}
|
||||
onLoadStart={[Function]}
|
||||
onMessage={[Function]}
|
||||
onNavigationStateChange={[Function]}
|
||||
pullToRefreshEnabled={true}
|
||||
ref={
|
||||
{
|
||||
"current": null,
|
||||
}
|
||||
javaScriptEnabled={true}
|
||||
mediaPlaybackRequiresUserAction={false}
|
||||
onError={[Function]}
|
||||
onHttpError={[Function]}
|
||||
onLoadEnd={[Function]}
|
||||
onLoadStart={[Function]}
|
||||
onMessage={[Function]}
|
||||
onNavigationStateChange={[Function]}
|
||||
pullToRefreshEnabled={true}
|
||||
ref={
|
||||
{
|
||||
"current": null,
|
||||
}
|
||||
sharedCookiesEnabled={true}
|
||||
showsHorizontalScrollIndicator={false}
|
||||
showsVerticalScrollIndicator={true}
|
||||
source={
|
||||
{
|
||||
"uri": "https://pezkuwichain.io/be-citizen",
|
||||
}
|
||||
}
|
||||
sharedCookiesEnabled={true}
|
||||
showsHorizontalScrollIndicator={false}
|
||||
showsVerticalScrollIndicator={true}
|
||||
source={
|
||||
{
|
||||
"uri": "https://pezkuwichain.io/be-citizen",
|
||||
}
|
||||
style={
|
||||
{
|
||||
"flex": 1,
|
||||
}
|
||||
}
|
||||
style={
|
||||
{
|
||||
"flex": 1,
|
||||
}
|
||||
thirdPartyCookiesEnabled={true}
|
||||
webviewDebuggingEnabled={true}
|
||||
}
|
||||
thirdPartyCookiesEnabled={true}
|
||||
webviewDebuggingEnabled={true}
|
||||
/>
|
||||
<View
|
||||
style={
|
||||
{
|
||||
"alignItems": "center",
|
||||
"backgroundColor": "rgba(255, 255, 255, 0.9)",
|
||||
"bottom": 0,
|
||||
"justifyContent": "center",
|
||||
"left": 0,
|
||||
"position": "absolute",
|
||||
"right": 0,
|
||||
"top": 0,
|
||||
}
|
||||
}
|
||||
>
|
||||
<ActivityIndicator
|
||||
color="#00A94F"
|
||||
size="large"
|
||||
/>
|
||||
<View
|
||||
<Text
|
||||
style={
|
||||
{
|
||||
"alignItems": "center",
|
||||
"backgroundColor": "rgba(255, 255, 255, 0.9)",
|
||||
"bottom": 0,
|
||||
"justifyContent": "center",
|
||||
"left": 0,
|
||||
"position": "absolute",
|
||||
"right": 0,
|
||||
"top": 0,
|
||||
"color": "#666",
|
||||
"fontSize": 14,
|
||||
"marginTop": 12,
|
||||
}
|
||||
}
|
||||
>
|
||||
<ActivityIndicator
|
||||
color="#00A94F"
|
||||
size="large"
|
||||
/>
|
||||
<Text
|
||||
style={
|
||||
{
|
||||
"color": "#666",
|
||||
"fontSize": 14,
|
||||
"marginTop": 12,
|
||||
}
|
||||
}
|
||||
>
|
||||
Loading...
|
||||
</Text>
|
||||
</View>
|
||||
Loading...
|
||||
</Text>
|
||||
</View>
|
||||
</RCTSafeAreaView>
|
||||
</View>
|
||||
`;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`EducationScreen should match snapshot 1`] = `
|
||||
<RCTSafeAreaView
|
||||
<View
|
||||
style={
|
||||
{
|
||||
"backgroundColor": "#FFFFFF",
|
||||
@@ -12,94 +12,86 @@ exports[`EducationScreen should match snapshot 1`] = `
|
||||
<View
|
||||
style={
|
||||
{
|
||||
"alignItems": "center",
|
||||
"backgroundColor": "#FFFFFF",
|
||||
"flex": 1,
|
||||
"borderBottomColor": "#E0E0E0",
|
||||
"borderBottomWidth": 1,
|
||||
"flexDirection": "row",
|
||||
"justifyContent": "space-between",
|
||||
"paddingHorizontal": 16,
|
||||
"paddingVertical": 12,
|
||||
}
|
||||
}
|
||||
>
|
||||
<View
|
||||
<Text
|
||||
style={
|
||||
{
|
||||
"alignItems": "center",
|
||||
"backgroundColor": "#FFFFFF",
|
||||
"borderBottomColor": "#E0E0E0",
|
||||
"borderBottomWidth": 1,
|
||||
"flexDirection": "row",
|
||||
"justifyContent": "space-between",
|
||||
"paddingHorizontal": 16,
|
||||
"paddingVertical": 12,
|
||||
"color": "#000",
|
||||
"flex": 1,
|
||||
"fontSize": 18,
|
||||
"fontWeight": "700",
|
||||
"textAlign": "center",
|
||||
}
|
||||
}
|
||||
>
|
||||
Perwerde
|
||||
</Text>
|
||||
<View
|
||||
accessibilityState={
|
||||
{
|
||||
"busy": undefined,
|
||||
"checked": undefined,
|
||||
"disabled": undefined,
|
||||
"expanded": undefined,
|
||||
"selected": undefined,
|
||||
}
|
||||
}
|
||||
accessibilityValue={
|
||||
{
|
||||
"max": undefined,
|
||||
"min": undefined,
|
||||
"now": undefined,
|
||||
"text": undefined,
|
||||
}
|
||||
}
|
||||
accessible={true}
|
||||
collapsable={false}
|
||||
focusable={true}
|
||||
onClick={[Function]}
|
||||
onResponderGrant={[Function]}
|
||||
onResponderMove={[Function]}
|
||||
onResponderRelease={[Function]}
|
||||
onResponderTerminate={[Function]}
|
||||
onResponderTerminationRequest={[Function]}
|
||||
onStartShouldSetResponder={[Function]}
|
||||
style={
|
||||
{
|
||||
"opacity": 1,
|
||||
"padding": 8,
|
||||
}
|
||||
}
|
||||
>
|
||||
<Text
|
||||
style={
|
||||
{
|
||||
"color": "#000",
|
||||
"flex": 1,
|
||||
"fontSize": 18,
|
||||
"fontWeight": "700",
|
||||
"textAlign": "center",
|
||||
"color": "#00A94F",
|
||||
"fontSize": 14,
|
||||
"fontWeight": "600",
|
||||
}
|
||||
}
|
||||
>
|
||||
Perwerde
|
||||
Reload
|
||||
</Text>
|
||||
<View
|
||||
accessibilityState={
|
||||
{
|
||||
"busy": undefined,
|
||||
"checked": undefined,
|
||||
"disabled": undefined,
|
||||
"expanded": undefined,
|
||||
"selected": undefined,
|
||||
}
|
||||
}
|
||||
accessibilityValue={
|
||||
{
|
||||
"max": undefined,
|
||||
"min": undefined,
|
||||
"now": undefined,
|
||||
"text": undefined,
|
||||
}
|
||||
}
|
||||
accessible={true}
|
||||
collapsable={false}
|
||||
focusable={true}
|
||||
onClick={[Function]}
|
||||
onResponderGrant={[Function]}
|
||||
onResponderMove={[Function]}
|
||||
onResponderRelease={[Function]}
|
||||
onResponderTerminate={[Function]}
|
||||
onResponderTerminationRequest={[Function]}
|
||||
onStartShouldSetResponder={[Function]}
|
||||
style={
|
||||
{
|
||||
"opacity": 1,
|
||||
"padding": 8,
|
||||
}
|
||||
}
|
||||
>
|
||||
<Text
|
||||
style={
|
||||
{
|
||||
"color": "#00A94F",
|
||||
"fontSize": 14,
|
||||
"fontWeight": "600",
|
||||
}
|
||||
}
|
||||
>
|
||||
Reload
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
<WebView
|
||||
allowsBackForwardNavigationGestures={true}
|
||||
allowsInlineMediaPlayback={true}
|
||||
bounces={true}
|
||||
cacheEnabled={true}
|
||||
cacheMode="LOAD_DEFAULT"
|
||||
domStorageEnabled={true}
|
||||
injectedJavaScript="
|
||||
</View>
|
||||
<WebView
|
||||
allowsBackForwardNavigationGestures={true}
|
||||
allowsInlineMediaPlayback={true}
|
||||
bounces={true}
|
||||
cacheEnabled={true}
|
||||
cacheMode="LOAD_DEFAULT"
|
||||
domStorageEnabled={true}
|
||||
injectedJavaScript="
|
||||
(function() {
|
||||
// Mark this as mobile app
|
||||
window.PEZKUWI_MOBILE = true;
|
||||
@@ -109,6 +101,36 @@ exports[`EducationScreen should match snapshot 1`] = `
|
||||
window.PEZKUWI_ADDRESS = '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY';
|
||||
window.PEZKUWI_ACCOUNT_NAME = 'Mobile Wallet';
|
||||
|
||||
// Inject auth session for automatic login
|
||||
|
||||
|
||||
window.PEZKUWI_USER_ID = 'test-user-id';
|
||||
window.PEZKUWI_USER_EMAIL = 'test@pezkuwichain.io';
|
||||
|
||||
// Auto-authenticate with Supabase if session token exists
|
||||
if (window.PEZKUWI_SESSION_TOKEN) {
|
||||
(function autoAuth(attempts = 0) {
|
||||
if (attempts > 50) {
|
||||
console.warn('[Mobile] Auto-auth timed out: window.supabase not found');
|
||||
return;
|
||||
}
|
||||
|
||||
if (window.supabase && window.supabase.auth) {
|
||||
window.supabase.auth.setSession({
|
||||
access_token: window.PEZKUWI_SESSION_TOKEN,
|
||||
refresh_token: window.PEZKUWI_REFRESH_TOKEN || ''
|
||||
}).then(function(res) {
|
||||
if (res.error) console.warn('[Mobile] Auto-auth error:', res.error);
|
||||
else console.log('[Mobile] Auto-authenticated successfully');
|
||||
}).catch(function(err) {
|
||||
console.warn('[Mobile] Auto-auth promise failed:', err);
|
||||
});
|
||||
} else {
|
||||
setTimeout(function() { autoAuth(attempts + 1); }, 100);
|
||||
}
|
||||
})(0);
|
||||
}
|
||||
|
||||
// Override console.log to send to React Native (for debugging)
|
||||
const originalConsoleLog = console.log;
|
||||
console.log = function(...args) {
|
||||
@@ -166,66 +188,65 @@ exports[`EducationScreen should match snapshot 1`] = `
|
||||
true; // Required for injectedJavaScript
|
||||
})();
|
||||
"
|
||||
javaScriptEnabled={true}
|
||||
mediaPlaybackRequiresUserAction={false}
|
||||
onError={[Function]}
|
||||
onHttpError={[Function]}
|
||||
onLoadEnd={[Function]}
|
||||
onLoadStart={[Function]}
|
||||
onMessage={[Function]}
|
||||
onNavigationStateChange={[Function]}
|
||||
pullToRefreshEnabled={true}
|
||||
ref={
|
||||
{
|
||||
"current": null,
|
||||
}
|
||||
javaScriptEnabled={true}
|
||||
mediaPlaybackRequiresUserAction={false}
|
||||
onError={[Function]}
|
||||
onHttpError={[Function]}
|
||||
onLoadEnd={[Function]}
|
||||
onLoadStart={[Function]}
|
||||
onMessage={[Function]}
|
||||
onNavigationStateChange={[Function]}
|
||||
pullToRefreshEnabled={true}
|
||||
ref={
|
||||
{
|
||||
"current": null,
|
||||
}
|
||||
sharedCookiesEnabled={true}
|
||||
showsHorizontalScrollIndicator={false}
|
||||
showsVerticalScrollIndicator={true}
|
||||
source={
|
||||
{
|
||||
"uri": "https://pezkuwichain.io/education",
|
||||
}
|
||||
}
|
||||
sharedCookiesEnabled={true}
|
||||
showsHorizontalScrollIndicator={false}
|
||||
showsVerticalScrollIndicator={true}
|
||||
source={
|
||||
{
|
||||
"uri": "https://pezkuwichain.io/education",
|
||||
}
|
||||
style={
|
||||
{
|
||||
"flex": 1,
|
||||
}
|
||||
}
|
||||
style={
|
||||
{
|
||||
"flex": 1,
|
||||
}
|
||||
thirdPartyCookiesEnabled={true}
|
||||
webviewDebuggingEnabled={true}
|
||||
}
|
||||
thirdPartyCookiesEnabled={true}
|
||||
webviewDebuggingEnabled={true}
|
||||
/>
|
||||
<View
|
||||
style={
|
||||
{
|
||||
"alignItems": "center",
|
||||
"backgroundColor": "rgba(255, 255, 255, 0.9)",
|
||||
"bottom": 0,
|
||||
"justifyContent": "center",
|
||||
"left": 0,
|
||||
"position": "absolute",
|
||||
"right": 0,
|
||||
"top": 0,
|
||||
}
|
||||
}
|
||||
>
|
||||
<ActivityIndicator
|
||||
color="#00A94F"
|
||||
size="large"
|
||||
/>
|
||||
<View
|
||||
<Text
|
||||
style={
|
||||
{
|
||||
"alignItems": "center",
|
||||
"backgroundColor": "rgba(255, 255, 255, 0.9)",
|
||||
"bottom": 0,
|
||||
"justifyContent": "center",
|
||||
"left": 0,
|
||||
"position": "absolute",
|
||||
"right": 0,
|
||||
"top": 0,
|
||||
"color": "#666",
|
||||
"fontSize": 14,
|
||||
"marginTop": 12,
|
||||
}
|
||||
}
|
||||
>
|
||||
<ActivityIndicator
|
||||
color="#00A94F"
|
||||
size="large"
|
||||
/>
|
||||
<Text
|
||||
style={
|
||||
{
|
||||
"color": "#666",
|
||||
"fontSize": 14,
|
||||
"marginTop": 12,
|
||||
}
|
||||
}
|
||||
>
|
||||
Loading...
|
||||
</Text>
|
||||
</View>
|
||||
Loading...
|
||||
</Text>
|
||||
</View>
|
||||
</RCTSafeAreaView>
|
||||
</View>
|
||||
`;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`GovernanceScreen should match snapshot 1`] = `
|
||||
<RCTSafeAreaView
|
||||
<View
|
||||
style={
|
||||
{
|
||||
"backgroundColor": "#FFFFFF",
|
||||
@@ -12,94 +12,86 @@ exports[`GovernanceScreen should match snapshot 1`] = `
|
||||
<View
|
||||
style={
|
||||
{
|
||||
"alignItems": "center",
|
||||
"backgroundColor": "#FFFFFF",
|
||||
"flex": 1,
|
||||
"borderBottomColor": "#E0E0E0",
|
||||
"borderBottomWidth": 1,
|
||||
"flexDirection": "row",
|
||||
"justifyContent": "space-between",
|
||||
"paddingHorizontal": 16,
|
||||
"paddingVertical": 12,
|
||||
}
|
||||
}
|
||||
>
|
||||
<View
|
||||
<Text
|
||||
style={
|
||||
{
|
||||
"alignItems": "center",
|
||||
"backgroundColor": "#FFFFFF",
|
||||
"borderBottomColor": "#E0E0E0",
|
||||
"borderBottomWidth": 1,
|
||||
"flexDirection": "row",
|
||||
"justifyContent": "space-between",
|
||||
"paddingHorizontal": 16,
|
||||
"paddingVertical": 12,
|
||||
"color": "#000",
|
||||
"flex": 1,
|
||||
"fontSize": 18,
|
||||
"fontWeight": "700",
|
||||
"textAlign": "center",
|
||||
}
|
||||
}
|
||||
>
|
||||
Governance
|
||||
</Text>
|
||||
<View
|
||||
accessibilityState={
|
||||
{
|
||||
"busy": undefined,
|
||||
"checked": undefined,
|
||||
"disabled": undefined,
|
||||
"expanded": undefined,
|
||||
"selected": undefined,
|
||||
}
|
||||
}
|
||||
accessibilityValue={
|
||||
{
|
||||
"max": undefined,
|
||||
"min": undefined,
|
||||
"now": undefined,
|
||||
"text": undefined,
|
||||
}
|
||||
}
|
||||
accessible={true}
|
||||
collapsable={false}
|
||||
focusable={true}
|
||||
onClick={[Function]}
|
||||
onResponderGrant={[Function]}
|
||||
onResponderMove={[Function]}
|
||||
onResponderRelease={[Function]}
|
||||
onResponderTerminate={[Function]}
|
||||
onResponderTerminationRequest={[Function]}
|
||||
onStartShouldSetResponder={[Function]}
|
||||
style={
|
||||
{
|
||||
"opacity": 1,
|
||||
"padding": 8,
|
||||
}
|
||||
}
|
||||
>
|
||||
<Text
|
||||
style={
|
||||
{
|
||||
"color": "#000",
|
||||
"flex": 1,
|
||||
"fontSize": 18,
|
||||
"fontWeight": "700",
|
||||
"textAlign": "center",
|
||||
"color": "#00A94F",
|
||||
"fontSize": 14,
|
||||
"fontWeight": "600",
|
||||
}
|
||||
}
|
||||
>
|
||||
Governance
|
||||
Reload
|
||||
</Text>
|
||||
<View
|
||||
accessibilityState={
|
||||
{
|
||||
"busy": undefined,
|
||||
"checked": undefined,
|
||||
"disabled": undefined,
|
||||
"expanded": undefined,
|
||||
"selected": undefined,
|
||||
}
|
||||
}
|
||||
accessibilityValue={
|
||||
{
|
||||
"max": undefined,
|
||||
"min": undefined,
|
||||
"now": undefined,
|
||||
"text": undefined,
|
||||
}
|
||||
}
|
||||
accessible={true}
|
||||
collapsable={false}
|
||||
focusable={true}
|
||||
onClick={[Function]}
|
||||
onResponderGrant={[Function]}
|
||||
onResponderMove={[Function]}
|
||||
onResponderRelease={[Function]}
|
||||
onResponderTerminate={[Function]}
|
||||
onResponderTerminationRequest={[Function]}
|
||||
onStartShouldSetResponder={[Function]}
|
||||
style={
|
||||
{
|
||||
"opacity": 1,
|
||||
"padding": 8,
|
||||
}
|
||||
}
|
||||
>
|
||||
<Text
|
||||
style={
|
||||
{
|
||||
"color": "#00A94F",
|
||||
"fontSize": 14,
|
||||
"fontWeight": "600",
|
||||
}
|
||||
}
|
||||
>
|
||||
Reload
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
<WebView
|
||||
allowsBackForwardNavigationGestures={true}
|
||||
allowsInlineMediaPlayback={true}
|
||||
bounces={true}
|
||||
cacheEnabled={true}
|
||||
cacheMode="LOAD_DEFAULT"
|
||||
domStorageEnabled={true}
|
||||
injectedJavaScript="
|
||||
</View>
|
||||
<WebView
|
||||
allowsBackForwardNavigationGestures={true}
|
||||
allowsInlineMediaPlayback={true}
|
||||
bounces={true}
|
||||
cacheEnabled={true}
|
||||
cacheMode="LOAD_DEFAULT"
|
||||
domStorageEnabled={true}
|
||||
injectedJavaScript="
|
||||
(function() {
|
||||
// Mark this as mobile app
|
||||
window.PEZKUWI_MOBILE = true;
|
||||
@@ -109,6 +101,36 @@ exports[`GovernanceScreen should match snapshot 1`] = `
|
||||
window.PEZKUWI_ADDRESS = '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY';
|
||||
window.PEZKUWI_ACCOUNT_NAME = 'Mobile Wallet';
|
||||
|
||||
// Inject auth session for automatic login
|
||||
|
||||
|
||||
window.PEZKUWI_USER_ID = 'test-user-id';
|
||||
window.PEZKUWI_USER_EMAIL = 'test@pezkuwichain.io';
|
||||
|
||||
// Auto-authenticate with Supabase if session token exists
|
||||
if (window.PEZKUWI_SESSION_TOKEN) {
|
||||
(function autoAuth(attempts = 0) {
|
||||
if (attempts > 50) {
|
||||
console.warn('[Mobile] Auto-auth timed out: window.supabase not found');
|
||||
return;
|
||||
}
|
||||
|
||||
if (window.supabase && window.supabase.auth) {
|
||||
window.supabase.auth.setSession({
|
||||
access_token: window.PEZKUWI_SESSION_TOKEN,
|
||||
refresh_token: window.PEZKUWI_REFRESH_TOKEN || ''
|
||||
}).then(function(res) {
|
||||
if (res.error) console.warn('[Mobile] Auto-auth error:', res.error);
|
||||
else console.log('[Mobile] Auto-authenticated successfully');
|
||||
}).catch(function(err) {
|
||||
console.warn('[Mobile] Auto-auth promise failed:', err);
|
||||
});
|
||||
} else {
|
||||
setTimeout(function() { autoAuth(attempts + 1); }, 100);
|
||||
}
|
||||
})(0);
|
||||
}
|
||||
|
||||
// Override console.log to send to React Native (for debugging)
|
||||
const originalConsoleLog = console.log;
|
||||
console.log = function(...args) {
|
||||
@@ -166,66 +188,65 @@ exports[`GovernanceScreen should match snapshot 1`] = `
|
||||
true; // Required for injectedJavaScript
|
||||
})();
|
||||
"
|
||||
javaScriptEnabled={true}
|
||||
mediaPlaybackRequiresUserAction={false}
|
||||
onError={[Function]}
|
||||
onHttpError={[Function]}
|
||||
onLoadEnd={[Function]}
|
||||
onLoadStart={[Function]}
|
||||
onMessage={[Function]}
|
||||
onNavigationStateChange={[Function]}
|
||||
pullToRefreshEnabled={true}
|
||||
ref={
|
||||
{
|
||||
"current": null,
|
||||
}
|
||||
javaScriptEnabled={true}
|
||||
mediaPlaybackRequiresUserAction={false}
|
||||
onError={[Function]}
|
||||
onHttpError={[Function]}
|
||||
onLoadEnd={[Function]}
|
||||
onLoadStart={[Function]}
|
||||
onMessage={[Function]}
|
||||
onNavigationStateChange={[Function]}
|
||||
pullToRefreshEnabled={true}
|
||||
ref={
|
||||
{
|
||||
"current": null,
|
||||
}
|
||||
sharedCookiesEnabled={true}
|
||||
showsHorizontalScrollIndicator={false}
|
||||
showsVerticalScrollIndicator={true}
|
||||
source={
|
||||
{
|
||||
"uri": "https://pezkuwichain.io/elections",
|
||||
}
|
||||
}
|
||||
sharedCookiesEnabled={true}
|
||||
showsHorizontalScrollIndicator={false}
|
||||
showsVerticalScrollIndicator={true}
|
||||
source={
|
||||
{
|
||||
"uri": "https://pezkuwichain.io/elections",
|
||||
}
|
||||
style={
|
||||
{
|
||||
"flex": 1,
|
||||
}
|
||||
}
|
||||
style={
|
||||
{
|
||||
"flex": 1,
|
||||
}
|
||||
thirdPartyCookiesEnabled={true}
|
||||
webviewDebuggingEnabled={true}
|
||||
}
|
||||
thirdPartyCookiesEnabled={true}
|
||||
webviewDebuggingEnabled={true}
|
||||
/>
|
||||
<View
|
||||
style={
|
||||
{
|
||||
"alignItems": "center",
|
||||
"backgroundColor": "rgba(255, 255, 255, 0.9)",
|
||||
"bottom": 0,
|
||||
"justifyContent": "center",
|
||||
"left": 0,
|
||||
"position": "absolute",
|
||||
"right": 0,
|
||||
"top": 0,
|
||||
}
|
||||
}
|
||||
>
|
||||
<ActivityIndicator
|
||||
color="#00A94F"
|
||||
size="large"
|
||||
/>
|
||||
<View
|
||||
<Text
|
||||
style={
|
||||
{
|
||||
"alignItems": "center",
|
||||
"backgroundColor": "rgba(255, 255, 255, 0.9)",
|
||||
"bottom": 0,
|
||||
"justifyContent": "center",
|
||||
"left": 0,
|
||||
"position": "absolute",
|
||||
"right": 0,
|
||||
"top": 0,
|
||||
"color": "#666",
|
||||
"fontSize": 14,
|
||||
"marginTop": 12,
|
||||
}
|
||||
}
|
||||
>
|
||||
<ActivityIndicator
|
||||
color="#00A94F"
|
||||
size="large"
|
||||
/>
|
||||
<Text
|
||||
style={
|
||||
{
|
||||
"color": "#666",
|
||||
"fontSize": 14,
|
||||
"marginTop": 12,
|
||||
}
|
||||
}
|
||||
>
|
||||
Loading...
|
||||
</Text>
|
||||
</View>
|
||||
Loading...
|
||||
</Text>
|
||||
</View>
|
||||
</RCTSafeAreaView>
|
||||
</View>
|
||||
`;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`P2PScreen should match snapshot 1`] = `
|
||||
<RCTSafeAreaView
|
||||
<View
|
||||
style={
|
||||
{
|
||||
"backgroundColor": "#FFFFFF",
|
||||
@@ -12,94 +12,86 @@ exports[`P2PScreen should match snapshot 1`] = `
|
||||
<View
|
||||
style={
|
||||
{
|
||||
"alignItems": "center",
|
||||
"backgroundColor": "#FFFFFF",
|
||||
"flex": 1,
|
||||
"borderBottomColor": "#E0E0E0",
|
||||
"borderBottomWidth": 1,
|
||||
"flexDirection": "row",
|
||||
"justifyContent": "space-between",
|
||||
"paddingHorizontal": 16,
|
||||
"paddingVertical": 12,
|
||||
}
|
||||
}
|
||||
>
|
||||
<View
|
||||
<Text
|
||||
style={
|
||||
{
|
||||
"alignItems": "center",
|
||||
"backgroundColor": "#FFFFFF",
|
||||
"borderBottomColor": "#E0E0E0",
|
||||
"borderBottomWidth": 1,
|
||||
"flexDirection": "row",
|
||||
"justifyContent": "space-between",
|
||||
"paddingHorizontal": 16,
|
||||
"paddingVertical": 12,
|
||||
"color": "#000",
|
||||
"flex": 1,
|
||||
"fontSize": 18,
|
||||
"fontWeight": "700",
|
||||
"textAlign": "center",
|
||||
}
|
||||
}
|
||||
>
|
||||
P2P Trading
|
||||
</Text>
|
||||
<View
|
||||
accessibilityState={
|
||||
{
|
||||
"busy": undefined,
|
||||
"checked": undefined,
|
||||
"disabled": undefined,
|
||||
"expanded": undefined,
|
||||
"selected": undefined,
|
||||
}
|
||||
}
|
||||
accessibilityValue={
|
||||
{
|
||||
"max": undefined,
|
||||
"min": undefined,
|
||||
"now": undefined,
|
||||
"text": undefined,
|
||||
}
|
||||
}
|
||||
accessible={true}
|
||||
collapsable={false}
|
||||
focusable={true}
|
||||
onClick={[Function]}
|
||||
onResponderGrant={[Function]}
|
||||
onResponderMove={[Function]}
|
||||
onResponderRelease={[Function]}
|
||||
onResponderTerminate={[Function]}
|
||||
onResponderTerminationRequest={[Function]}
|
||||
onStartShouldSetResponder={[Function]}
|
||||
style={
|
||||
{
|
||||
"opacity": 1,
|
||||
"padding": 8,
|
||||
}
|
||||
}
|
||||
>
|
||||
<Text
|
||||
style={
|
||||
{
|
||||
"color": "#000",
|
||||
"flex": 1,
|
||||
"fontSize": 18,
|
||||
"fontWeight": "700",
|
||||
"textAlign": "center",
|
||||
"color": "#00A94F",
|
||||
"fontSize": 14,
|
||||
"fontWeight": "600",
|
||||
}
|
||||
}
|
||||
>
|
||||
P2P Trading
|
||||
Reload
|
||||
</Text>
|
||||
<View
|
||||
accessibilityState={
|
||||
{
|
||||
"busy": undefined,
|
||||
"checked": undefined,
|
||||
"disabled": undefined,
|
||||
"expanded": undefined,
|
||||
"selected": undefined,
|
||||
}
|
||||
}
|
||||
accessibilityValue={
|
||||
{
|
||||
"max": undefined,
|
||||
"min": undefined,
|
||||
"now": undefined,
|
||||
"text": undefined,
|
||||
}
|
||||
}
|
||||
accessible={true}
|
||||
collapsable={false}
|
||||
focusable={true}
|
||||
onClick={[Function]}
|
||||
onResponderGrant={[Function]}
|
||||
onResponderMove={[Function]}
|
||||
onResponderRelease={[Function]}
|
||||
onResponderTerminate={[Function]}
|
||||
onResponderTerminationRequest={[Function]}
|
||||
onStartShouldSetResponder={[Function]}
|
||||
style={
|
||||
{
|
||||
"opacity": 1,
|
||||
"padding": 8,
|
||||
}
|
||||
}
|
||||
>
|
||||
<Text
|
||||
style={
|
||||
{
|
||||
"color": "#00A94F",
|
||||
"fontSize": 14,
|
||||
"fontWeight": "600",
|
||||
}
|
||||
}
|
||||
>
|
||||
Reload
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
<WebView
|
||||
allowsBackForwardNavigationGestures={true}
|
||||
allowsInlineMediaPlayback={true}
|
||||
bounces={true}
|
||||
cacheEnabled={true}
|
||||
cacheMode="LOAD_DEFAULT"
|
||||
domStorageEnabled={true}
|
||||
injectedJavaScript="
|
||||
</View>
|
||||
<WebView
|
||||
allowsBackForwardNavigationGestures={true}
|
||||
allowsInlineMediaPlayback={true}
|
||||
bounces={true}
|
||||
cacheEnabled={true}
|
||||
cacheMode="LOAD_DEFAULT"
|
||||
domStorageEnabled={true}
|
||||
injectedJavaScript="
|
||||
(function() {
|
||||
// Mark this as mobile app
|
||||
window.PEZKUWI_MOBILE = true;
|
||||
@@ -109,6 +101,36 @@ exports[`P2PScreen should match snapshot 1`] = `
|
||||
window.PEZKUWI_ADDRESS = '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY';
|
||||
window.PEZKUWI_ACCOUNT_NAME = 'Mobile Wallet';
|
||||
|
||||
// Inject auth session for automatic login
|
||||
|
||||
|
||||
window.PEZKUWI_USER_ID = 'test-user-id';
|
||||
window.PEZKUWI_USER_EMAIL = 'test@pezkuwichain.io';
|
||||
|
||||
// Auto-authenticate with Supabase if session token exists
|
||||
if (window.PEZKUWI_SESSION_TOKEN) {
|
||||
(function autoAuth(attempts = 0) {
|
||||
if (attempts > 50) {
|
||||
console.warn('[Mobile] Auto-auth timed out: window.supabase not found');
|
||||
return;
|
||||
}
|
||||
|
||||
if (window.supabase && window.supabase.auth) {
|
||||
window.supabase.auth.setSession({
|
||||
access_token: window.PEZKUWI_SESSION_TOKEN,
|
||||
refresh_token: window.PEZKUWI_REFRESH_TOKEN || ''
|
||||
}).then(function(res) {
|
||||
if (res.error) console.warn('[Mobile] Auto-auth error:', res.error);
|
||||
else console.log('[Mobile] Auto-authenticated successfully');
|
||||
}).catch(function(err) {
|
||||
console.warn('[Mobile] Auto-auth promise failed:', err);
|
||||
});
|
||||
} else {
|
||||
setTimeout(function() { autoAuth(attempts + 1); }, 100);
|
||||
}
|
||||
})(0);
|
||||
}
|
||||
|
||||
// Override console.log to send to React Native (for debugging)
|
||||
const originalConsoleLog = console.log;
|
||||
console.log = function(...args) {
|
||||
@@ -166,66 +188,65 @@ exports[`P2PScreen should match snapshot 1`] = `
|
||||
true; // Required for injectedJavaScript
|
||||
})();
|
||||
"
|
||||
javaScriptEnabled={true}
|
||||
mediaPlaybackRequiresUserAction={false}
|
||||
onError={[Function]}
|
||||
onHttpError={[Function]}
|
||||
onLoadEnd={[Function]}
|
||||
onLoadStart={[Function]}
|
||||
onMessage={[Function]}
|
||||
onNavigationStateChange={[Function]}
|
||||
pullToRefreshEnabled={true}
|
||||
ref={
|
||||
{
|
||||
"current": null,
|
||||
}
|
||||
javaScriptEnabled={true}
|
||||
mediaPlaybackRequiresUserAction={false}
|
||||
onError={[Function]}
|
||||
onHttpError={[Function]}
|
||||
onLoadEnd={[Function]}
|
||||
onLoadStart={[Function]}
|
||||
onMessage={[Function]}
|
||||
onNavigationStateChange={[Function]}
|
||||
pullToRefreshEnabled={true}
|
||||
ref={
|
||||
{
|
||||
"current": null,
|
||||
}
|
||||
sharedCookiesEnabled={true}
|
||||
showsHorizontalScrollIndicator={false}
|
||||
showsVerticalScrollIndicator={true}
|
||||
source={
|
||||
{
|
||||
"uri": "https://pezkuwichain.io/p2p",
|
||||
}
|
||||
}
|
||||
sharedCookiesEnabled={true}
|
||||
showsHorizontalScrollIndicator={false}
|
||||
showsVerticalScrollIndicator={true}
|
||||
source={
|
||||
{
|
||||
"uri": "https://pezkuwichain.io/p2p",
|
||||
}
|
||||
style={
|
||||
{
|
||||
"flex": 1,
|
||||
}
|
||||
}
|
||||
style={
|
||||
{
|
||||
"flex": 1,
|
||||
}
|
||||
thirdPartyCookiesEnabled={true}
|
||||
webviewDebuggingEnabled={true}
|
||||
}
|
||||
thirdPartyCookiesEnabled={true}
|
||||
webviewDebuggingEnabled={true}
|
||||
/>
|
||||
<View
|
||||
style={
|
||||
{
|
||||
"alignItems": "center",
|
||||
"backgroundColor": "rgba(255, 255, 255, 0.9)",
|
||||
"bottom": 0,
|
||||
"justifyContent": "center",
|
||||
"left": 0,
|
||||
"position": "absolute",
|
||||
"right": 0,
|
||||
"top": 0,
|
||||
}
|
||||
}
|
||||
>
|
||||
<ActivityIndicator
|
||||
color="#00A94F"
|
||||
size="large"
|
||||
/>
|
||||
<View
|
||||
<Text
|
||||
style={
|
||||
{
|
||||
"alignItems": "center",
|
||||
"backgroundColor": "rgba(255, 255, 255, 0.9)",
|
||||
"bottom": 0,
|
||||
"justifyContent": "center",
|
||||
"left": 0,
|
||||
"position": "absolute",
|
||||
"right": 0,
|
||||
"top": 0,
|
||||
"color": "#666",
|
||||
"fontSize": 14,
|
||||
"marginTop": 12,
|
||||
}
|
||||
}
|
||||
>
|
||||
<ActivityIndicator
|
||||
color="#00A94F"
|
||||
size="large"
|
||||
/>
|
||||
<Text
|
||||
style={
|
||||
{
|
||||
"color": "#666",
|
||||
"fontSize": 14,
|
||||
"marginTop": 12,
|
||||
}
|
||||
}
|
||||
>
|
||||
Loading...
|
||||
</Text>
|
||||
</View>
|
||||
Loading...
|
||||
</Text>
|
||||
</View>
|
||||
</RCTSafeAreaView>
|
||||
</View>
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user