You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add option for custom test host in Damus Purple developer settings
This commit adds a developer setting that allows the use of a custom
host for testing. This was added to allow testing on real devices
without the need for pushing changes into staging.
========
Testing
========
Test 1: Production not affected
-------------------------------
PASS
Device: iPhone 13 Mini
iOS: 17.3
Damus: This version
Steps:
1. Run app on a device logged into a real Damus Purple account
2. Scroll down the home feed. Make sure that other Purple members still show up with a star next to their profile. PASS
3. Go to the Damus Purple screen. Ensure that account info shows up and is correct. PASS
4. Ensure auto-translations appear. PASS
Test 2: Check custom test URL
-----------------------------
PASS
(Continued from test 1)
1. Run local damus-api and damus-website on the same computer
2. Change developer purple env setting to local test
3. Set the host url to the local IP address of the test server
4. Go through LN purchase flow. Ensure it works correctly. PASS
Signed-off-by: Daniel D’Aquino <[email protected]>
Reviewed-by: William Casarin <[email protected]>
Signed-off-by: William Casarin <[email protected]>
returnNSLocalizedString("Test (localhost)", comment:"Label indicating a localhost test environment for Damus Purple functionality (Developer feature)")
20
+
returnNSLocalizedString("Test (local)", comment:"Label indicating a local test environment for Damus Purple functionality (Developer feature)")
19
21
case.staging:
20
22
returnNSLocalizedString("Staging", comment:"Label indicating a staging test environment for Damus Purple functionality (Developer feature)")
Toggle(NSLocalizedString("Enable experimental Purple API support", comment:"Developer mode setting to enable experimental Purple API support."), isOn: $settings.enable_experimental_purple_api)
29
29
.toggleStyle(.switch)
30
30
31
-
Picker(NSLocalizedString("Damus Purple environment", comment:"Prompt selection of the Damus purple environment (Developer feature to switch between real/production mode to test modes)."), selection: $settings.purple_enviroment){
31
+
Picker(NSLocalizedString("Damus Purple environment", comment:"Prompt selection of the Damus purple environment (Developer feature to switch between real/production mode to test modes)."),
32
+
selection:Binding(
33
+
get:{()->DamusPurpleEnvironmentin
34
+
switch settings.purple_enviroment {
35
+
case.local_test(_):
36
+
return.local_test(host:nil) // Avoid errors related to a value which is not a valid picker option
37
+
default:
38
+
return settings.purple_enviroment
39
+
}
40
+
},
41
+
set:{ new_value in
42
+
settings.purple_enviroment = new_value
43
+
}
44
+
)
45
+
){
32
46
ForEach(DamusPurpleEnvironment.allCases, id: \.self){ purple_environment in
33
47
Text(purple_environment.text_description())
34
-
.tag(purple_environment.rawValue)
48
+
.tag(purple_environment.to_string())
35
49
}
36
50
}
51
+
52
+
if case .local_test(_)= settings.purple_enviroment {
53
+
TextField(
54
+
NSLocalizedString("URL", comment:"Custom URL host for Damus Purple testing"),
0 commit comments