|
111 | 111 | end
|
112 | 112 | end
|
113 | 113 |
|
114 |
| - describe 'app_icon' do |
| 114 | + describe 'app_icon handling' do |
115 | 115 | context 'when providing an URL' do
|
116 | 116 | it 'includes the icon in the intro text' do
|
117 |
| - comment = run_described_fastlane_action( |
118 |
| - app_display_name: 'My Cool App', |
119 |
| - app_icon: 'https://localhost/foo.png', |
120 |
| - download_url: 'https://localhost/foo.apk' |
121 |
| - ) |
122 |
| - expect(comment).to include "<img align='top' src='https://localhost/foo.png' width='20px' alt='App Icon' />📲 " |
| 117 | + comment = run_described_fastlane_action(base_params.merge(app_icon: valid_app_icon_url)) |
| 118 | + expect(comment).to include "<img align='top' src='#{valid_app_icon_url}' width='20px' alt='App Icon' />📲 " |
123 | 119 | end
|
124 | 120 | end
|
125 | 121 |
|
126 | 122 | context 'when providing an emoji code' do
|
127 | 123 | it 'includes the icon in the intro text' do
|
128 |
| - comment = run_described_fastlane_action( |
129 |
| - app_display_name: 'My Cool App', |
130 |
| - app_icon: ':jetpack:', |
131 |
| - download_url: 'https://localhost/foo.apk' |
132 |
| - ) |
| 124 | + comment = run_described_fastlane_action(base_params.merge(app_icon: ':jetpack:')) |
133 | 125 | expect(comment).to include "<img align='top' src='https://raw.githubusercontent.com/buildkite/emojis/main/img-buildkite-64/jetpack.png' width='20px' alt='App Icon' />📲 "
|
134 | 126 | end
|
| 127 | + |
| 128 | + it 'handles emoji codes with special characters' do |
| 129 | + comment = run_described_fastlane_action(base_params.merge(app_icon: ':plus-one:')) |
| 130 | + expect(comment).to include 'plus-one.png' |
| 131 | + end |
| 132 | + end |
| 133 | + |
| 134 | + context 'when no icon is provided' do |
| 135 | + context 'when using Firebase App Distribution' do |
| 136 | + let(:firebase_release_info) do |
| 137 | + { |
| 138 | + displayVersion: '28.7', |
| 139 | + buildVersion: '1287003', |
| 140 | + testingUri: 'https://appdistribution.firebase.google.com/testerapps/1:123456:ios:abcdef/releases/xyz', |
| 141 | + firebaseConsoleUri: 'https://console.firebase.google.com/project/apps-test/appdistribution/app/ios:com.example.myapp/releases/xyz' |
| 142 | + } |
| 143 | + end |
| 144 | + |
| 145 | + before do |
| 146 | + stub_const('Fastlane::Actions::SharedValues::FIREBASE_APP_DISTRO_RELEASE', :firebase_app_distro_release) |
| 147 | + allow(Fastlane::Actions).to receive(:lane_context).and_return({ firebase_app_distro_release: firebase_release_info }) |
| 148 | + end |
| 149 | + |
| 150 | + it 'uses the firebase icon' do |
| 151 | + comment = run_described_fastlane_action(app_display_name: 'My App') |
| 152 | + expect(comment).to include 'firebase.png' |
| 153 | + end |
| 154 | + end |
| 155 | + |
| 156 | + context 'when using a Firebase download URL' do |
| 157 | + it 'uses the firebase icon' do |
| 158 | + comment = run_described_fastlane_action( |
| 159 | + app_display_name: 'My App', |
| 160 | + download_url: 'https://appdistribution.firebase.google.com/testerapps/1:123456:ios:abcdef/releases/xyz' |
| 161 | + ) |
| 162 | + expect(comment).to include 'firebase.png' |
| 163 | + end |
| 164 | + end |
| 165 | + |
| 166 | + context 'when using a non-Firebase download URL' do |
| 167 | + it 'does not include any icon' do |
| 168 | + comment = run_described_fastlane_action(base_params.merge(app_icon: nil)) |
| 169 | + expect(comment).not_to include 'firebase.png' |
| 170 | + expect(comment).to match(/^<p>📲 You can test/) |
| 171 | + end |
| 172 | + end |
135 | 173 | end
|
136 | 174 | end
|
137 | 175 |
|
|
301 | 339 | expect(comment).to include "<td><b>Direct Download</b></td><td><a href='https://example.com/myapp.apk'><code>myapp.apk</code></a></td>"
|
302 | 340 | end
|
303 | 341 |
|
| 342 | + it 'does not include rows for FAD metadata' do |
| 343 | + comment = run_described_fastlane_action( |
| 344 | + app_display_name: 'My App', |
| 345 | + download_url: 'https://example.com/myapp.apk' |
| 346 | + ) |
| 347 | + expect(comment).not_to include %r{<td>.*Build Number.*</td>} |
| 348 | + expect(comment).not_to include %r{<td>.*Version.*</td>} |
| 349 | + expect(comment).not_to include %r{<td>.*Bundle ID.*</td>} |
| 350 | + expect(comment).not_to include %r{<td>.*Application ID.*</td>} |
| 351 | + end |
| 352 | + |
304 | 353 | it 'does not include any default footnote if no explicit footnote is provided' do
|
305 | 354 | comment = run_described_fastlane_action(
|
306 | 355 | app_display_name: 'My App',
|
|
346 | 395 | <p><img align='top' src='https://raw.githubusercontent.com/buildkite/emojis/main/img-buildkite-64/jetpack.png' width='20px' alt='App Icon' />📲 You can test the changes from this Pull Request in <b>The Best App</b> by scanning the QR code below to install the corresponding build.</p>
|
347 | 396 | <table>
|
348 | 397 | <tr>
|
349 |
| - <td rowspan='9' width='260px'><img src='https://api.qrserver.com/v1/create-qr-code/?size=500x500&qzone=4&data=https%3A%2F%2Fexample.com%2Fbestapp.apk' width='250' height='250' /></td> |
| 398 | + <td rowspan='6' width='260px'><img src='https://api.qrserver.com/v1/create-qr-code/?size=500x500&qzone=4&data=https%3A%2F%2Fexample.com%2Fbestapp.apk' width='250' height='250' /></td> |
350 | 399 | <td><b>App Name</b></td><td>The Best App</td>
|
351 | 400 | </tr>
|
352 | 401 | <tr><td><b>Version Name</b></td><td>28.2</td></tr>
|
353 | 402 | <tr><td><b>Version Code</b></td><td>1280200108</td></tr>
|
354 | 403 | <tr><td><b>Flavor</b></td><td>Debug</td></tr>
|
355 |
| - <tr><td><b>Build Number</b></td><td><code></code></td></tr> |
356 |
| - <tr><td><b>Version</b></td><td><code></code></td></tr> |
357 |
| - <tr><td><b>Application ID</b></td><td><code></code></td></tr> |
358 | 404 | <tr><td><b>Commit</b></td><td>a1b2c3f</td></tr>
|
359 | 405 | <tr><td><b>Direct Download</b></td><td><a href='https://example.com/bestapp.apk'><code>bestapp.apk</code></a></td></tr>
|
360 | 406 | </table>
|
|
379 | 425 | <details><summary>📲 You can test the changes from this Pull Request in <b>The Best App</b> by scanning the QR code below to install the corresponding build.</summary>
|
380 | 426 | <table>
|
381 | 427 | <tr>
|
382 |
| - <td rowspan='8' width='260px'><img src='https://api.qrserver.com/v1/create-qr-code/?size=500x500&qzone=4&data=https%3A%2F%2Fexample.com%2Fbestapp.apk' width='250' height='250' /></td> |
| 428 | + <td rowspan='5' width='260px'><img src='https://api.qrserver.com/v1/create-qr-code/?size=500x500&qzone=4&data=https%3A%2F%2Fexample.com%2Fbestapp.apk' width='250' height='250' /></td> |
383 | 429 | <td><b>App Name</b></td><td>The Best App</td>
|
384 | 430 | </tr>
|
385 | 431 | <tr><td><b>Version Name</b></td><td>28.2</td></tr>
|
386 | 432 | <tr><td><b>Version Code</b></td><td>1280200108</td></tr>
|
387 |
| - <tr><td><b>Build Number</b></td><td><code></code></td></tr> |
388 |
| - <tr><td><b>Version</b></td><td><code></code></td></tr> |
389 |
| - <tr><td><b>Application ID</b></td><td><code></code></td></tr> |
390 | 433 | <tr><td><b>Commit</b></td><td>a1b2c3f</td></tr>
|
391 | 434 | <tr><td><b>Direct Download</b></td><td><a href='https://example.com/bestapp.apk'><code>bestapp.apk</code></a></td></tr>
|
392 | 435 | </table>
|
|
395 | 438 | EXPECTED_COMMENT
|
396 | 439 | end
|
397 | 440 | end
|
398 |
| - |
399 |
| - describe 'app_icon handling' do |
400 |
| - context 'when providing an URL' do |
401 |
| - it 'includes the icon in the intro text' do |
402 |
| - comment = run_described_fastlane_action(base_params.merge(app_icon: valid_app_icon_url)) |
403 |
| - expect(comment).to include "<img align='top' src='#{valid_app_icon_url}' width='20px' alt='App Icon' />📲 " |
404 |
| - end |
405 |
| - end |
406 |
| - |
407 |
| - context 'when providing an emoji code' do |
408 |
| - it 'includes the icon in the intro text' do |
409 |
| - comment = run_described_fastlane_action(base_params.merge(app_icon: ':jetpack:')) |
410 |
| - expect(comment).to include "<img align='top' src='https://raw.githubusercontent.com/buildkite/emojis/main/img-buildkite-64/jetpack.png' width='20px' alt='App Icon' />📲 " |
411 |
| - end |
412 |
| - |
413 |
| - it 'handles emoji codes with special characters' do |
414 |
| - comment = run_described_fastlane_action(base_params.merge(app_icon: ':plus-one:')) |
415 |
| - expect(comment).to include 'plus-one.png' |
416 |
| - end |
417 |
| - end |
418 |
| - |
419 |
| - context 'when no icon is provided' do |
420 |
| - context 'when using Firebase App Distribution' do |
421 |
| - let(:firebase_release_info) do |
422 |
| - { |
423 |
| - displayVersion: '28.7', |
424 |
| - buildVersion: '1287003', |
425 |
| - testingUri: 'https://appdistribution.firebase.google.com/testerapps/1:123456:ios:abcdef/releases/xyz', |
426 |
| - firebaseConsoleUri: 'https://console.firebase.google.com/project/apps-test/appdistribution/app/ios:com.example.myapp/releases/xyz' |
427 |
| - } |
428 |
| - end |
429 |
| - |
430 |
| - before do |
431 |
| - stub_const('Fastlane::Actions::SharedValues::FIREBASE_APP_DISTRO_RELEASE', :firebase_app_distro_release) |
432 |
| - allow(Fastlane::Actions).to receive(:lane_context).and_return({ firebase_app_distro_release: firebase_release_info }) |
433 |
| - end |
434 |
| - |
435 |
| - it 'uses the firebase icon' do |
436 |
| - comment = run_described_fastlane_action(app_display_name: 'My App') |
437 |
| - expect(comment).to include 'firebase.png' |
438 |
| - end |
439 |
| - end |
440 |
| - |
441 |
| - context 'when using a Firebase download URL' do |
442 |
| - it 'uses the firebase icon' do |
443 |
| - comment = run_described_fastlane_action( |
444 |
| - app_display_name: 'My App', |
445 |
| - download_url: 'https://appdistribution.firebase.google.com/testerapps/1:123456:ios:abcdef/releases/xyz' |
446 |
| - ) |
447 |
| - expect(comment).to include 'firebase.png' |
448 |
| - end |
449 |
| - end |
450 |
| - |
451 |
| - context 'when using a non-Firebase download URL' do |
452 |
| - it 'does not include any icon' do |
453 |
| - comment = run_described_fastlane_action(base_params.merge(app_icon: nil)) |
454 |
| - expect(comment).not_to include 'firebase.png' |
455 |
| - expect(comment).to match(/^<p>📲 You can test/) |
456 |
| - end |
457 |
| - end |
458 |
| - end |
459 |
| - end |
460 | 441 | end
|
0 commit comments