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

fix(tests): battle hardened tests against multiple device sizes #576

Merged
merged 5 commits into from
Apr 10, 2023

Conversation

bassrock
Copy link
Member

Summary

@timc-mozilla discovered that our test was not battle hardended against small device sizes. This makes use of a scrollTo function to ensure that we scroll to a specific element instead of unless scrolling or assuming something is on screen.

This will also fixes flakyness I discovered around tags where tags were always appearing in a different order. This should be fully fixed in #568 and any work here is a stop gap for tests and sanity.

Implementation Details

There are a few helper libraries we could import that would help with our tests, but I chose to use a very basic scrollTo function instead since the one I found had not been updated in a while.

Test Steps

  • Try the add tags tests on a iphone mini

PR Checklist:

  • Added Unit / UI tests
  • Self Review (review, clean up, documentation, run tests)
  • Basic Self QA

Screenshots

@bassrock bassrock requested a review from a team as a code owner April 10, 2023 14:37
@bassrock bassrock requested review from nzeltzer and Gio2018 and removed request for a team April 10, 2023 14:37
@@ -21,7 +21,8 @@ class TagsFilterViewModel: ObservableObject {
}

func getAllTags() -> [TagType] {
arrangeTags(with: fetchedTags?.compactMap({ $0.name }) ?? [])
// Finding unique elements using set
arrangeTags(with: Array(Set(fetchedTags?.compactMap({ $0.name }) ?? [])))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to do this, because at times the FilterTagsView would contain duplicate tags. Should be fixed in #568

allTags.append(contentsOf: fetchedTags)
}
return allTags.compactMap { TagType.tag($0) }
return tags.sorted().compactMap { TagType.tag($0) }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing recent tags instead for #568

@@ -212,8 +212,8 @@ workflows:
## It uses the values in MICRO_IGLU_REGISTRY_URL and MICRO_IGLU_API_KEY
echo "Run snowplow"
brew install wget openjdk
wget https://github.com/snowplow-incubator/snowplow-micro/releases/download/micro-1.5.0/snowplow-micro-1.5.0.jar
java -jar snowplow-micro-1.5.0.jar &
wget https://github.com/snowplow-incubator/snowplow-micro/releases/download/micro-1.6.0/snowplow-micro-1.6.0.jar
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updating snowplow

@cyndichin cyndichin mentioned this pull request Apr 10, 2023
3 tasks
@pocket-ci
Copy link
Contributor

Messages
📖 No SwiftLint violations! 🎉
📖 Project coverage: 80.31%
📖 Edited 11 files
📖 Created 0 files

PocketKit: Coverage: 79.75

File Coverage
TagsFilterViewModel.swift 100.0%

Sync: Coverage: 88.23

File Coverage
Requests.swift 86.41%

Generated by 🚫 Danger Swift against be61cce

Copy link
Contributor

@timc-mozilla timc-mozilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks cool! excited for these changes

@bassrock bassrock merged commit 864f902 into develop Apr 10, 2023
@bassrock bassrock deleted the test-fixes branch April 10, 2023 14:55
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.

3 participants