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

Add filtering button for test failures #23

Merged

Conversation

pawelurb
Copy link
Collaborator

I think it resolves #4?

The button is added as a bar button item, its state is replicated across both TestSuitesView and TestMethodsView.

TestSuitesView

Simulator Screen Shot - iPhone 12 - 2022-02-16 at 19 50 51
Simulator Screen Shot - iPhone 12 - 2022-02-16 at 19 50 53

TestMethodsView

Simulator Screen Shot - iPhone 12 - 2022-02-16 at 19 51 13
Simulator Screen Shot - iPhone 12 - 2022-02-16 at 19 51 19

Let me know if you need anything added/changed here. I tested it manually but it seems like it works, potentially we could add some snapshots with mock results but I didn't want to add another dependency so I'll leave it as is for now.

I can also grab #5 next if you'd like.

Copy link
Owner

@Losiowaty Losiowaty left a comment

Choose a reason for hiding this comment

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

Perfect, thanks for contributing ❤️

Button(action: {
isToggled.toggle()
}) {
let imageName = isToggled ? "xmark.octagon.fill" : "xmark.octagon"
Copy link
Owner

Choose a reason for hiding this comment

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

Nice!
I didn't know you could add "regular" code inside view builders!

var body: some View {
List(methods) { method in
let results = failuresOnly ? methods.filter { $0.result.isSuccess == false } : methods
Copy link
Owner

Choose a reason for hiding this comment

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

Hmm, this is a little weird 😅
This block of code is a regular "block", right?
How come Swift allows to omit return keyword in multiple statement block? 🤔
Or did they change them to be result builders? (I'm not really super up-to-date with SwiftUI 😅 )

@Losiowaty Losiowaty merged commit e9927f9 into Losiowaty:main Feb 16, 2022
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.

Add filter button (failed only)
2 participants