Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NoQA] Fix Jest test for unread indicator when app is reopened from background #15183

Merged
merged 1 commit into from
Feb 15, 2023

Conversation

francoisl
Copy link
Contributor

@francoisl francoisl commented Feb 15, 2023

Details

This is a follow-up of #14520 / #15097, where we changed the app's behavior to keep the unread indicator present after backgrounding and reopening the app.

Fixed Issues

No Github issue, fixes automated tests. Context:

Tests

Run the test 'Keeps the new line indicator when the user moves the App to the background' manually, make sure it passes.

  • Verify that no errors appear in the JS console

Offline tests

N/A

QA Steps

No QA

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • MacOS / Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

Web

N/A

Mobile Web - Chrome

N/A

Mobile Web - Safari

N/A

Desktop

N/A

iOS

N/A

Android

N/A

This is a follow-up of #14520 / #15097, where we changed the app's
behavior to keep the unread indicator present after backgrounding
and reopening the app.
@francoisl francoisl requested a review from puneetlath February 15, 2023 20:31
@francoisl francoisl self-assigned this Feb 15, 2023
@francoisl francoisl marked this pull request as ready for review February 15, 2023 20:32
@francoisl francoisl requested a review from a team as a code owner February 15, 2023 20:32
@melvin-bot melvin-bot bot requested review from Gonals and removed request for a team February 15, 2023 20:33
@MelvinBot
Copy link

@Gonals Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@puneetlath
Copy link
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • MacOS / Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android

@francoisl francoisl merged commit f839c56 into main Feb 15, 2023
@francoisl francoisl deleted the francois-fixJestTest branch February 15, 2023 21:17
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@francoisl
Copy link
Contributor Author

@github-actions
Copy link
Contributor

Performance Comparison Report 📊

Significant Changes To Duration

There are no entries

Meaningless Changes To Duration

Show entries
Name Duration
App start TTI 698.673 ms → 712.119 ms (+13.446 ms, +1.9%)
App start runJsBundle 192.188 ms → 194.969 ms (+2.781 ms, +1.4%)
Open Search Page TTI 641.092 ms → 641.259 ms (+0.167 ms, ±0.0%)
App start nativeLaunch 20.133 ms → 20.200 ms (+0.067 ms, ±0.0%)
App start regularAppStart 0.014 ms → 0.016 ms (+0.003 ms, +20.5%) 🟡
Show details
Name Duration
App start TTI Baseline
Mean: 698.673 ms
Stdev: 34.180 ms (4.9%)
Runs: 648.3148860000074 660.7721579996869 661.9387389998883 663.4329169997945 665.7161020003259 667.3630649996921 669.1390070002526 669.1711719995365 670.7883379999548 674.1101890001446 674.2211250001565 676.5305629996583 676.7892899997532 681.4731270000339 689.5737370001152 691.3001840002835 697.2426289999858 700.5261949999258 701.2439700001851 703.3042989997193 711.1385209998116 711.9476110003889 713.4931479999796 713.636924999766 719.5916940001771 726.6493279999122 727.279923000373 735.6227639997378 738.3716040002182 742.2512819999829 776.5136299999431 798.095963999629

Current
Mean: 712.119 ms
Stdev: 37.681 ms (5.3%)
Runs: 657.8067810004577 662.5875220000744 663.7279120003805 667.3130719996989 668.2812890000641 674.4081739997491 675.1742080003023 678.3649340001866 682.6674990002066 682.9658709997311 689.1499690003693 692.5785940000787 696.1035860003904 696.5166300004348 704.5305819995701 707.7421810002998 708.9255459997803 710.9904330000281 717.4088740004227 719.476432999596 720.1951940003783 729.6710919998586 730.5592250004411 731.6661200001836 741.0285109998658 750.5400040000677 753.5338740004227 754.8864489998668 754.9780440004542 776.3909369995818 782.2805180000141 805.3679039999843
App start runJsBundle Baseline
Mean: 192.188 ms
Stdev: 22.905 ms (11.9%)
Runs: 160 162 163 167 169 170 174 174 175 175 177 177 178 178 184 189 191 192 194 194 202 204 204 204 205 214 218 219 225 226 233 253

Current
Mean: 194.969 ms
Stdev: 22.763 ms (11.7%)
Runs: 163 164 169 170 173 174 175 175 176 177 179 181 185 188 191 191 192 194 195 196 197 199 209 215 216 217 217 221 222 226 228 264
Open Search Page TTI Baseline
Mean: 641.092 ms
Stdev: 15.061 ms (2.3%)
Runs: 611.4669589996338 616.0448409998789 623.3890380002558 623.7402349999174 623.8739829994738 625.0328369997442 625.5889490004629 627.2463379995897 628.350260999985 632.1238209996372 632.7398680001497 633.74015300069 635.7519130008295 638.560059000738 639.9379070000723 640.0254720002413 641.6274819998071 642.0186769999564 642.4237469993532 642.8682860005647 650.677612000145 652.0550540005788 652.1901860004291 652.2546799993142 652.4986169999465 654.8240559995174 656.3291830001399 656.912760999985 658.256674000062 663.322877000086 663.3838709993288 675.6746829999611

Current
Mean: 641.259 ms
Stdev: 23.067 ms (3.6%)
Runs: 607.3273930000141 608.1750489994884 612.8074139999226 612.9385170005262 615.956991000101 616.1603600000963 618.3757330002263 622.1582030002028 623.6901449998841 625.0969650000334 626.4145099995658 626.6051850002259 626.6795659996569 633.3107910007238 633.6757000004873 638.3291430007666 640.7609459999949 640.8384600002319 644.4772140001878 646.341594000347 649.0561119997874 651.6483159996569 651.7119549997151 654.7185060000047 659.272583999671 665.6790780005977 672.1910809995607 673.4499920001253 674.7414959995076 679.3761799996719 684.1350910002366 684.1728520002216
App start nativeLaunch Baseline
Mean: 20.133 ms
Stdev: 2.262 ms (11.2%)
Runs: 17 17 17 17 18 19 19 19 19 19 19 19 19 20 20 20 20 20 20 20 20 21 21 22 22 22 22 24 26 26

Current
Mean: 20.200 ms
Stdev: 2.386 ms (11.8%)
Runs: 18 18 18 18 18 18 18 19 19 19 19 19 19 19 19 19 20 20 20 20 20 21 21 21 21 23 25 25 26 26
App start regularAppStart Baseline
Mean: 0.014 ms
Stdev: 0.001 ms (5.9%)
Runs: 0.012206999585032463 0.0125730000436306 0.012776999734342098 0.012776999734342098 0.012897999957203865 0.0129399998113513 0.013020999729633331 0.013020999729633331 0.013062000274658203 0.013143000192940235 0.013182999566197395 0.013182999566197395 0.013224000111222267 0.013264999724924564 0.0133050000295043 0.013306000269949436 0.013345999643206596 0.013387000188231468 0.01342800073325634 0.013631000183522701 0.013915999792516232 0.014038000255823135 0.014119000174105167 0.014119000174105167 0.014282000251114368 0.014403999783098698 0.014485999941825867 0.014526000246405602 0.014852000400424004 0.015298999845981598 0.015706999227404594

Current
Mean: 0.016 ms
Stdev: 0.001 ms (6.8%)
Runs: 0.014444999396800995 0.014932999387383461 0.015217999927699566 0.015339999459683895 0.015421000309288502 0.015421999618411064 0.015583999454975128 0.015747000463306904 0.0157880000770092 0.015909000299870968 0.015910000540316105 0.015910000540316105 0.015991000458598137 0.015992000699043274 0.016030999831855297 0.016195000149309635 0.016195000149309635 0.016195000149309635 0.016234999522566795 0.016600999981164932 0.016764000058174133 0.016845999285578728 0.016846000216901302 0.016927000135183334 0.017171000130474567 0.0174150001257658 0.01749700028449297 0.0188400000333786 0.019084000028669834 0.019123999401926994

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/francoisl in version: 1.2.73-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/francoisl in version: 1.2.73-1 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 failure ❌
🕸 web 🕸 success ✅

1 similar comment
@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/francoisl in version: 1.2.73-1 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 failure ❌
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants