tags
+ expect(comment).to include '| HTML Key | bold | '
+ expect(comment).to include '
| Link | example.com | '
+ expect(comment).to include '
| Mixed & Content | Version & Build 1.0 | '
+ end
+ end
+
+ describe 'metadata handling' do
+ it 'handles empty metadata gracefully' do
+ comment = run_described_fastlane_action(base_params.merge(metadata: {}))
+ # Should still include default metadata
+ expect(comment).to include 'App Name | '
+ expect(comment).to include 'Commit | '
+ end
+
+ it 'handles nil metadata values' do
+ comment = run_described_fastlane_action(base_params.merge(metadata: { 'Nil Value': nil }))
+ expect(comment).not_to include 'Nil Value | '
+ end
+
+ it 'handles very long metadata values' do
+ long_value = 'a' * 1000
+ comment = run_described_fastlane_action(base_params.merge(metadata: { 'Long Value': long_value }))
+ expect(comment).to include long_value
+ end
+ end
+
describe 'cases common to all operating modes' do
describe 'app_display_name' do
it 'includes the app display name as part of the intro text' do
comment = run_described_fastlane_action(
- app_display_name: 'My Cool App',
+ app_display_name: 'My Cool App & Co.',
download_url: 'https://localhost/foo.apk'
)
- expect(comment).to include '📲 You can test the changes from this Pull Request in My Cool App'
+ expect(comment).to include '📲 You can test the changes from this Pull Request in My Cool App & Co.'
end
it 'includes the app display name as part of implicit metadata' do
comment = run_described_fastlane_action(
- app_display_name: 'My Cool App',
+ app_display_name: 'My Cool App & Co.',
download_url: 'https://localhost/foo.apk'
)
- expect(comment).to include 'App Name | My Cool App | '
+ expect(comment).to include 'App Name | My Cool App & Co. | '
end
end
@@ -34,16 +119,7 @@
app_icon: 'https://localhost/foo.png',
download_url: 'https://localhost/foo.apk'
)
- expect(comment).to include "
📲 "
- end
-
- it 'includes the icon next to the App Name in metadata' do
- comment = run_described_fastlane_action(
- app_display_name: 'My Cool App',
- app_icon: 'https://localhost/foo.png',
- download_url: 'https://localhost/foo.apk'
- )
- expect(comment).to include "App Name | My Cool App | "
+ expect(comment).to include "
📲 "
end
end
@@ -54,16 +130,7 @@
app_icon: ':jetpack:',
download_url: 'https://localhost/foo.apk'
)
- expect(comment).to include "
📲 "
- end
-
- it 'includes the icon next to the App Name in metadata' do
- comment = run_described_fastlane_action(
- app_display_name: 'My Cool App',
- app_icon: ':jetpack:',
- download_url: 'https://localhost/foo.apk'
- )
- expect(comment).to include "App Name | My Cool App | "
+ expect(comment).to include "
📲 "
end
end
end
@@ -77,7 +144,6 @@
end
it 'includes the provided footnote if one was provided explicitly' do
- custom_footnote = 'Note that Google Sign-In in not available in those builds'
comment = run_described_fastlane_action(
app_display_name: 'My App',
download_url: 'https://localhost/foo.apk',
@@ -87,489 +153,307 @@
end
end
- context 'when using App Center with explicit parameters' do
- it 'raises an error if neither `app_center_app_name` nor `download_url` is provided' do
- expect do
- run_described_fastlane_action(
- app_display_name: 'My App',
- app_center_org_name: 'BestOrg'
- )
- end.to raise_error(FastlaneCore::Interface::FastlaneError, described_class::NO_INSTALL_URL_ERROR_MESSAGE)
+ context 'when using Firebase App Distribution' do
+ let(:firebase_release_info) do
+ {
+ displayVersion: '28.7',
+ buildVersion: '1287003',
+ testingUri: 'https://appdistribution.firebase.google.com/testerapps/1:123456:ios:abcdef/releases/xyz',
+ firebaseConsoleUri: 'https://console.firebase.google.com/project/apps-test/appdistribution/app/ios:com.example.myapp/releases/xyz'
+ }
end
- describe 'checking specific content is present' do
- it 'generates the proper App Center link and QR code given an org, app name and release ID' do
- comment = run_described_fastlane_action(
- app_display_name: 'My App',
- app_center_org_name: 'My-Org',
- app_center_app_name: 'My-App',
- app_center_release_id: '1337'
- )
- expect(comment).to include "My-App #1337"
- expect(comment).to include 'https://api.qrserver.com/v1/create-qr-code/?size=500x500&qzone=4&data=https%3A%2F%2Finstall.appcenter.ms%2Forgs%2FMy-Org%2Fapps%2FMy-App%2Freleases%2F1337'
- end
-
- it 'uses the App Center link for the QR code even if a `download_url` is provided' do
- comment = run_described_fastlane_action(
- app_display_name: 'My App',
- app_center_org_name: 'My-Org',
- app_center_app_name: 'My-App',
- app_center_release_id: '1337',
- download_url: 'https://foo.cloudfront.net/someuuid/myapp-prototype-build-pr1337-a1b2c3f.apk'
- )
- expect(comment).to include "Direct Download | myapp-prototype-build-pr1337-a1b2c3f.apk | "
- expect(comment).to include 'https://api.qrserver.com/v1/create-qr-code/?size=500x500&qzone=4&data=https%3A%2F%2Finstall.appcenter.ms%2Forgs%2FMy-Org%2Fapps%2FMy-App%2Freleases%2F1337'
- # Inferred metadata rows: App Name, Commit, Direct Download, App Center Build
- expect(comment).to include "App Name | My App | '
- expect(comment).to include 'Version:Short | 28.1 | '
- expect(comment).to include 'Version:Long | 281003 | '
- expect(comment).to include 'Build Config | Prototype | '
- expect(comment).to include 'Commit | a1b2c3f | '
- expect(comment).to include "
| App Center Build | My-App #1337 |
"
- # Additional inferred metadata rows: App Name, Commit, App Center Build
- expect(comment).to include "Note: Google Sign-In in not available in those builds'
- )
-
- expect(comment).to eq <<~EXPECTED_COMMENT
- 📲 You can test the changes from this Pull Request in The Best App by scanning the QR code below to install the corresponding build.
-
-
-  |
- App Name | The Best App |
-
- | Version:Short | 28.2 |
- | Version:Long | 28.2.0.108 |
- | Flavor | Celray |
- | Commit | a1b2c3f |
- | App Center Build | BestApp #8888 |
-
- Note: Google Sign-In in not available in those builds
- EXPECTED_COMMENT
- end
-
- it 'generates a HTML table comment including the direct link if provided' do
- metadata = {
- 'Version:Short': '28.2',
- 'Version:Long': '28.2.0.108'
- }
-
- comment = run_described_fastlane_action(
- app_display_name: 'The Best App',
- app_center_org_name: 'BestOrg',
- app_center_app_name: 'BestApp',
- app_center_release_id: '8888',
- download_url: 'https://bestfront.cloudfront.net/feed42/bestapp-pr1357-a1b2c3f.apk',
- metadata: metadata
- )
-
- expect(comment).to eq <<~EXPECTED_COMMENT
- 📲 You can test the changes from this Pull Request in The Best App by scanning the QR code below to install the corresponding build.
-
- Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.
- EXPECTED_COMMENT
- end
-
- it 'generates a HTML table in a spoiler block if fold is true' do
- metadata = {
- 'Version:Short': '28.2',
- 'Version:Long': '28.2.0.108',
- Flavor: 'Celray',
- Configuration: 'Debug'
- }
-
- comment = run_described_fastlane_action(
- app_display_name: 'The Best App',
- app_center_org_name: 'BestOrg',
- app_center_app_name: 'BestApp',
- app_center_release_id: '1234',
- fold: true,
- metadata: metadata,
- footnote: 'Note: Google Sign-In in not available in those builds'
- )
-
- expect(comment).to eq <<~EXPECTED_COMMENT
- 📲 You can test the changes from this Pull Request in The Best App by scanning the QR code below to install the corresponding build.
-
-
-  |
- App Name | The Best App |
-
- | Version:Short | 28.2 |
- | Version:Long | 28.2.0.108 |
- | Flavor | Celray |
- | Configuration | Debug |
- | Commit | a1b2c3f |
- | App Center Build | BestApp #1234 |
-
- Note: Google Sign-In in not available in those builds
-
- EXPECTED_COMMENT
- end
+ it 'extracts metadata from Firebase release info' do
+ comment = run_described_fastlane_action(
+ app_display_name: 'My App'
+ )
+ expect(comment).to include ' | Version | 28.7 | '
+ expect(comment).to include 'Build Number | 1287003 | '
+ expect(comment).to include 'Bundle ID | com.example.myapp | '
+ expect(comment).to include 'Installation URL | xyz | '
end
- end
- context 'when using App Center and relying on implicit info from `lane_context`' do
- let(:fake_lane_context) do |example|
- {
- app_name: 'My-App-Alpha',
- app_display_name: 'My App (Alpha)',
- id: '1337',
- version: '1287003',
- short_version: '28.7',
- app_os: example.metadata[:app_os] || 'Android',
- bundle_identifier: 'com.stubfactory.myapp',
- app_icon_url: 'https://assets.appcenter.ms/My-App-Alpha/1337/icon.png'
- }.transform_keys(&:to_s)
+ it 'generates QR code for Firebase testing URL' do
+ comment = run_described_fastlane_action(
+ app_display_name: 'My App'
+ )
+ expect(comment).to include 'https://api.qrserver.com/v1/create-qr-code/?size=500x500&qzone=4&data=https%3A%2F%2Fappdistribution.firebase.google.com%2Ftesterapps%2F1%3A123456%3Aios%3Aabcdef%2Freleases%2Fxyz'
end
- before do
- stub_const('Fastlane::Actions::SharedValues::APPCENTER_BUILD_INFORMATION', :fake_app_center_build_info)
- allow(Fastlane::Actions).to receive(:lane_context).and_return({ fake_app_center_build_info: fake_lane_context })
+ it 'includes and prioritizes user-provided metadata over implicit ones' do
+ metadata = {
+ Version: '42.3',
+ 'Build Number': '4203008',
+ 'Build Config': 'Prototype'
+ }
+ comment = run_described_fastlane_action(
+ app_display_name: 'My App',
+ metadata: metadata
+ )
+ expect(comment).to include 'Version | 42.3 | ' # explicitly provided, overriding the implicit value
+ expect(comment).not_to include 'Version | 28.7 | ' # otherwise implicitly added if it were not overridden
+ expect(comment).to include 'Build Number | 4203008 | ' # explicitly provided, overriding the implicit value
+ expect(comment).not_to include 'Build Number | 1287003 | ' # otherwise implicitly added if it were not overridden
+ expect(comment).to include 'Build Config | Prototype | ' # not overriding any implicit one
+ # Additional inferred metadata rows: App Name, Bundle ID, Commit, Installation URL
+ expect(comment).to include "My App (Alpha) #1337"
- expect(comment).to include 'https://api.qrserver.com/v1/create-qr-code/?size=500x500&qzone=4&data=https%3A%2F%2Finstall.appcenter.ms%2Forgs%2FMy-Org%2Fapps%2FMy-App-Alpha%2Freleases%2F1337'
- end
-
- it 'uses the App Center link for the QR code even if a `download_url` is provided' do
- comment = run_described_fastlane_action(
- app_display_name: 'My App',
- app_center_org_name: 'My-Org',
- download_url: 'https://foo.cloudfront.net/someuuid/myapp-prototype-build-pr1337-a1b2c3f.apk'
- )
- expect(comment).to include 'https://api.qrserver.com/v1/create-qr-code/?size=500x500&qzone=4&data=https%3A%2F%2Finstall.appcenter.ms%2Forgs%2FMy-Org%2Fapps%2FMy-App-Alpha%2Freleases%2F1337'
- # Inferred metadata rows: App Name, Build Number, Version, Application ID, Commit, Direct Download, App Center Build
- expect(comment).to include " | App Name | My App | '
+ expect(comment).to include 'Version:Short | 28.1 | '
+ expect(comment).to include 'Version:Long | 281003 | '
+ expect(comment).to include 'Build Config | Prototype | '
+ expect(comment).to include 'Bundle ID | com.example.myapp | '
+ expect(comment).to include 'Commit | a1b2c3f | '
+ expect(comment).to include "Installation URL | xyz | "
+ # Additional inferred metadata rows: Build Number, Version
+ expect(comment).to include "Version | 42.3 | ' # explicitly provided, overriding the implicit value
- expect(comment).not_to include 'Version | 28.7 | ' # otherwise implicitly added if it were not overridden
- expect(comment).to include 'Build Number | 4203008 | ' # explicitly provided, overriding the implicit value
- expect(comment).not_to include 'Build Number | 1287003 | ' # otherwise implicitly added if it were not overridden
- expect(comment).to include 'Build Config | Prototype | ' # not overriding any implicit one
- # Additional inferred metadata rows: App Name, Application ID, Commit, App Center Build
- expect(comment).to include "Application ID | com.stubfactory.myapp | '
- expect(comment).not_to include 'Bundle ID'
+ it 'uses "Application ID" as the name for the bundle identifier' do
+ comment = run_described_fastlane_action(
+ app_display_name: 'My App'
+ )
+ expect(comment).to include 'Application ID | com.example.myapp | '
+ expect(comment).not_to include 'Bundle ID'
+ end
end
- it 'uses "Bundle ID" as the name for the `bundle_identifier` value if using iOS', app_os: 'iOS' do
- comment = run_described_fastlane_action(
- app_display_name: 'My App',
- app_center_org_name: 'My-Org'
- )
- expect(comment).to include 'Bundle ID | com.stubfactory.myapp | '
- expect(comment).not_to include 'Application ID'
- end
+ context 'when using iOS' do
+ let(:firebase_release_info) do
+ {
+ displayVersion: '28.7',
+ buildVersion: '1287003',
+ testingUri: 'https://appdistribution.firebase.google.com/testerapps/1:123456:ios:abcdef/releases/xyz',
+ firebaseConsoleUri: 'https://console.firebase.google.com/project/apps-test/appdistribution/app/ios:com.example.myapp/releases/xyz'
+ }
+ end
- it 'includes the direct link if one is provided' do
- comment = run_described_fastlane_action(
- app_display_name: 'My App',
- app_center_org_name: 'My-Org',
- download_url: 'https://foo.cloudfront.net/someuuid/myapp-prototype-build-pr1337-a1b2c3f.apk'
- )
- expect(comment).to include "Direct Download | myapp-prototype-build-pr1337-a1b2c3f.apk | "
- # Inferred metadata rows: App Name, Build Number, Version, Application ID, Commit, Direct Download, App Center Build
- expect(comment).to include "Bundle ID | com.example.myapp | '
+ expect(comment).not_to include 'Application ID'
+ end
end
+ end
- it 'includes the App Center default footnote if no explicit footnote is provided' do
+ describe 'footnote behavior' do
+ it 'includes the default Firebase footnote if no explicit footnote is provided' do
comment = run_described_fastlane_action(
- app_display_name: 'My App',
- app_center_org_name: 'BestOrg'
+ app_display_name: 'My App'
)
- expect(comment).to include described_class::DEFAULT_APP_CENTER_FOOTNOTE
+ expect(comment).to include described_class::DEFAULT_FOOTNOTE
end
it 'includes the provided footnote if one was provided explicitly' do
- custom_footnote = 'Note that Google Sign-In in not available in those builds'
comment = run_described_fastlane_action(
app_display_name: 'My App',
- app_center_org_name: 'My-Org',
footnote: custom_footnote
)
expect(comment).to include custom_footnote
- expect(comment).not_to include described_class::DEFAULT_APP_CENTER_FOOTNOTE
+ expect(comment).not_to include described_class::DEFAULT_FOOTNOTE
end
end
+ end
- describe 'validating full comment' do
- it 'generates a standard HTML table comment by default, with all the information provided' do
- metadata = {
- Configuration: 'Debug'
- }
+ context 'when using direct download URL' do
+ it 'generates QR code for the direct download URL' do
+ comment = run_described_fastlane_action(
+ app_display_name: 'My App',
+ download_url: 'https://example.com/myapp.apk'
+ )
+ expect(comment).to include 'https://api.qrserver.com/v1/create-qr-code/?size=500x500&qzone=4&data=https%3A%2F%2Fexample.com%2Fmyapp.apk'
+ end
- comment = run_described_fastlane_action(
- app_display_name: 'The Best App',
- app_center_org_name: 'BestOrg',
- metadata: metadata,
- footnote: 'Note: Google Sign-In in not available in those builds'
- )
+ it 'includes the direct download link in metadata' do
+ comment = run_described_fastlane_action(
+ app_display_name: 'My App',
+ download_url: 'https://example.com/myapp.apk'
+ )
+ expect(comment).to include "Direct Download | myapp.apk | "
+ end
- expect(comment).to eq <<~EXPECTED_COMMENT
-
📲 You can test the changes from this Pull Request in The Best App by scanning the QR code below to install the corresponding build.
-
-
-  |
- App Name | The Best App |
-
- | Configuration | Debug |
- | Build Number | 1287003 |
- | Version | 28.7 |
- | Application ID | com.stubfactory.myapp |
- | Commit | a1b2c3f |
- | App Center Build | My App (Alpha) #1337 |
-
- Note: Google Sign-In in not available in those builds
- EXPECTED_COMMENT
- end
+ it 'does not include any default footnote if no explicit footnote is provided' do
+ comment = run_described_fastlane_action(
+ app_display_name: 'My App',
+ download_url: 'https://example.com/myapp.apk'
+ )
+ expect(comment).not_to include described_class::DEFAULT_FOOTNOTE
+ end
- it 'generates a HTML table comment including the direct link if provided' do
- comment = run_described_fastlane_action(
- app_display_name: 'The Best App',
- app_center_org_name: 'BestOrg',
- download_url: 'https://bestfront.cloudfront.net/feed42/bestapp-pr1357-a1b2c3f.apk'
- )
+ it 'includes the provided footnote if one was provided explicitly' do
+ comment = run_described_fastlane_action(
+ app_display_name: 'My App',
+ download_url: 'https://example.com/myapp.apk',
+ footnote: custom_footnote
+ )
+ expect(comment).to include custom_footnote
+ end
- expect(comment).to eq <<~EXPECTED_COMMENT
-
📲 You can test the changes from this Pull Request in The Best App by scanning the QR code below to install the corresponding build.
-
- Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.
- EXPECTED_COMMENT
- end
+ it 'includes the default footnote if no explicit one is provided but the download URL is a Firebase URL' do
+ comment = run_described_fastlane_action(
+ app_display_name: 'My App',
+ download_url: 'https://appdistribution.firebase.google.com/testerapps/1:123456:ios:abcdef/releases/xyz'
+ )
+ expect(comment).to include described_class::DEFAULT_FOOTNOTE
+ end
+ end
- it 'generates a HTML table in a spoiler block if fold is true' do
- metadata = {
- 'Google Login': 'Disabled'
- }
+ describe 'validating full comment' do
+ it 'generates a standard HTML table comment by default' do
+ metadata = {
+ 'Version Name': '28.2',
+ 'Version Code': '1280200108',
+ Flavor: 'Debug'
+ }
- comment = run_described_fastlane_action(
- app_display_name: 'The Best App',
- app_center_org_name: 'BestOrg',
- fold: true,
- metadata: metadata,
- footnote: 'Note: Google Sign-In in not available in those builds'
- )
+ comment = run_described_fastlane_action(
+ app_display_name: 'The Best App',
+ download_url: 'https://example.com/bestapp.apk',
+ metadata: metadata,
+ app_icon: ':jetpack:'
+ )
- expect(comment).to eq <<~EXPECTED_COMMENT
-
📲 You can test the changes from this Pull Request in The Best App by scanning the QR code below to install the corresponding build.
-
-
-  |
- App Name | The Best App |
-
- | Google Login | Disabled |
- | Build Number | 1287003 |
- | Version | 28.7 |
- | Application ID | com.stubfactory.myapp |
- | Commit | a1b2c3f |
- | App Center Build | My App (Alpha) #1337 |
-
- Note: Google Sign-In in not available in those builds
-
- EXPECTED_COMMENT
- end
+ expect(comment).to eq <<~EXPECTED_COMMENT
+
📲 You can test the changes from this Pull Request in The Best App by scanning the QR code below to install the corresponding build.
+
+
+  |
+ App Name | The Best App |
+
+ | Version Name | 28.2 |
+ | Version Code | 1280200108 |
+ | Flavor | Debug |
+ | Build Number | |
+ | Version | |
+ | Application ID | |
+ | Commit | a1b2c3f |
+ | Direct Download | bestapp.apk |
+
+ EXPECTED_COMMENT
end
- end
- context 'when not using App Center' do
- it 'raises an error if no `download_url` is provided' do
- expect do
- run_described_fastlane_action(
- app_display_name: 'My App'
- )
- end.to raise_error(FastlaneCore::Interface::FastlaneError, described_class::NO_INSTALL_URL_ERROR_MESSAGE)
- end
+ it 'generates a HTML table in a spoiler block if fold is true' do
+ metadata = {
+ 'Version Name': '28.2',
+ 'Version Code': '1280200108'
+ }
- describe 'checking specific content is present' do
- it 'generates the proper QR code from the download url' do
- comment = run_described_fastlane_action(
- app_display_name: 'My App',
- download_url: 'https://foo.cloudfront.net/someuuid/myapp-prototype-build-pr1337-a1b2c3f.apk'
- )
- expect(comment).to include 'https://api.qrserver.com/v1/create-qr-code/?size=500x500&qzone=4&data=https%3A%2F%2Ffoo.cloudfront.net%2Fsomeuuid%2Fmyapp-prototype-build-pr1337-a1b2c3f.apk'
- end
+ comment = run_described_fastlane_action(
+ app_display_name: 'The Best App',
+ download_url: 'https://example.com/bestapp.apk',
+ fold: true,
+ metadata: metadata,
+ footnote: custom_footnote
+ )
- it 'includes the direct link as metadata' do
- comment = run_described_fastlane_action(
- app_display_name: 'My App',
- download_url: 'https://foo.cloudfront.net/someuuid/myapp-prototype-build-pr1337-a1b2c3f.apk'
- )
- expect(comment).to include "Direct Download | myapp-prototype-build-pr1337-a1b2c3f.apk | "
+ expect(comment).to eq <<~EXPECTED_COMMENT
+ 📲 You can test the changes from this Pull Request in The Best App by scanning the QR code below to install the corresponding build.
+
+
+  |
+ App Name | The Best App |
+
+ | Version Name | 28.2 |
+ | Version Code | 1280200108 |
+ | Build Number | |
+ | Version | |
+ | Application ID | |
+ | Commit | a1b2c3f |
+ | Direct Download | bestapp.apk |
+
+ Note: Google Sign-In is not available in those builds
+
+ EXPECTED_COMMENT
+ end
+ end
+
+ describe 'app_icon handling' do
+ context 'when providing an URL' do
+ it 'includes the icon in the intro text' do
+ comment = run_described_fastlane_action(base_params.merge(app_icon: valid_app_icon_url))
+ expect(comment).to include "
📲 "
end
+ end
- it 'does not include the App Center default footnote if no explicit footnote is provided' do
- comment = run_described_fastlane_action(
- app_display_name: 'My App',
- download_url: 'https://localhost/foo.apk'
- )
- expect(comment).not_to include described_class::DEFAULT_APP_CENTER_FOOTNOTE
+ context 'when providing an emoji code' do
+ it 'includes the icon in the intro text' do
+ comment = run_described_fastlane_action(base_params.merge(app_icon: ':jetpack:'))
+ expect(comment).to include "
📲 "
end
- it 'includes the provided footnote if one was provided explicitly' do
- comment = run_described_fastlane_action(
- app_display_name: 'My App',
- download_url: 'https://localhost/foo.apk',
- footnote: 'The link to this APK might stop working after a retention delay of 30 days.'
- )
- expect(comment).to include 'The link to this APK might stop working after a retention delay of 30 days.'
+ it 'handles emoji codes with special characters' do
+ comment = run_described_fastlane_action(base_params.merge(app_icon: ':plus-one:'))
+ expect(comment).to include 'plus-one.png'
end
end
- describe 'validating full comment' do
- it 'generates a standard HTML table comment by default, with all the information provided' do
- metadata = {
- 'Version Name': '28.2',
- 'Version Code': '1280200108',
- Flavor: 'Celray'
- }
+ context 'when no icon is provided' do
+ context 'when using Firebase App Distribution' do
+ let(:firebase_release_info) do
+ {
+ displayVersion: '28.7',
+ buildVersion: '1287003',
+ testingUri: 'https://appdistribution.firebase.google.com/testerapps/1:123456:ios:abcdef/releases/xyz',
+ firebaseConsoleUri: 'https://console.firebase.google.com/project/apps-test/appdistribution/app/ios:com.example.myapp/releases/xyz'
+ }
+ end
- comment = run_described_fastlane_action(
- app_display_name: 'The Best App',
- download_url: 'https://bestfront.cloudfront.net/feed42/bestapp-pr1357-a1b2c3f.apk',
- metadata: metadata,
- footnote: 'Note: Google Sign-In in not available in those builds'
- )
+ before do
+ stub_const('Fastlane::Actions::SharedValues::FIREBASE_APP_DISTRO_RELEASE', :firebase_app_distro_release)
+ allow(Fastlane::Actions).to receive(:lane_context).and_return({ firebase_app_distro_release: firebase_release_info })
+ end
- expect(comment).to eq <<~EXPECTED_COMMENT
- 📲 You can test the changes from this Pull Request in The Best App by scanning the QR code below to install the corresponding build.
-
-
-  |
- App Name | The Best App |
-
- | Version Name | 28.2 |
- | Version Code | 1280200108 |
- | Flavor | Celray |
- | Commit | a1b2c3f |
- | Direct Download | bestapp-pr1357-a1b2c3f.apk |
-
- Note: Google Sign-In in not available in those builds
- EXPECTED_COMMENT
+ it 'uses the firebase icon' do
+ comment = run_described_fastlane_action(app_display_name: 'My App')
+ expect(comment).to include 'firebase.png'
+ end
end
- it 'generates a HTML table in a spoiler block if fold is true' do
- metadata = {
- 'Version Name': '28.2',
- 'Version Code': '1280200108',
- Flavor: 'Celray',
- Configuration: 'Debug'
- }
-
- comment = run_described_fastlane_action(
- app_display_name: 'The Best App',
- download_url: 'https://bestfront.cloudfront.net/feed42/bestapp-pr1357-a1b2c3f.apk',
- fold: true,
- metadata: metadata,
- footnote: 'Note: Google Sign-In in not available in those builds'
- )
+ context 'when using a Firebase download URL' do
+ it 'uses the firebase icon' do
+ comment = run_described_fastlane_action(
+ app_display_name: 'My App',
+ download_url: 'https://appdistribution.firebase.google.com/testerapps/1:123456:ios:abcdef/releases/xyz'
+ )
+ expect(comment).to include 'firebase.png'
+ end
+ end
- expect(comment).to eq <<~EXPECTED_COMMENT
- 📲 You can test the changes from this Pull Request in The Best App by scanning the QR code below to install the corresponding build.
-
-
-  |
- App Name | The Best App |
-
- | Version Name | 28.2 |
- | Version Code | 1280200108 |
- | Flavor | Celray |
- | Configuration | Debug |
- | Commit | a1b2c3f |
- | Direct Download | bestapp-pr1357-a1b2c3f.apk |
-
- Note: Google Sign-In in not available in those builds
-
- EXPECTED_COMMENT
+ context 'when using a non-Firebase download URL' do
+ it 'does not include any icon' do
+ comment = run_described_fastlane_action(base_params.merge(app_icon: nil))
+ expect(comment).not_to include 'firebase.png'
+ expect(comment).to match(/^📲 You can test/)
+ end
end
end
end