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

[Buttons] Add states snapshot tests. #6639

Merged
merged 2 commits into from Feb 19, 2019
Merged

[Buttons] Add states snapshot tests. #6639

merged 2 commits into from Feb 19, 2019

Conversation

romoore
Copy link
Contributor

@romoore romoore commented Feb 18, 2019

Simple snapshot tests for the main UIControlStates.

Simple snapshot tests for the main UIControlStates.
@romoore romoore added [Buttons] type:Test A test must be written. [testing] labels Feb 18, 2019
@material-automation
Copy link

This PR affects multiple components.

@material-automation
Copy link

material-automation commented Feb 18, 2019

bazel detected changes to the following targets:

//components/AppBar:unit_tests
//components/AppBar:unit_tests_IPAD_PRO_12_9_IN_9_3
//components/AppBar:unit_tests_IPAD_PRO_12_9_IN_9_3_test_bundle
//components/AppBar:unit_tests_IPHONE_5_IN_8_1
//components/AppBar:unit_tests_IPHONE_5_IN_8_1_test_bundle
//components/AppBar:unit_tests_IPHONE_7_PLUS_IN_10_3
//components/AppBar:unit_tests_IPHONE_7_PLUS_IN_10_3_test_bundle
//components/AppBar:unit_tests_IPHONE_X_IN_11_0
//components/AppBar:unit_tests_IPHONE_X_IN_11_0_test_bundle
//components/BottomAppBar:snapshot_tests
//components/BottomAppBar:snapshot_tests_test_bundle
//components/BottomAppBar:unit_tests
//components/BottomAppBar:unit_tests_IPAD_PRO_12_9_IN_9_3
//components/BottomAppBar:unit_tests_IPAD_PRO_12_9_IN_9_3_test_bundle
//components/BottomAppBar:unit_tests_IPHONE_5_IN_8_1
//components/BottomAppBar:unit_tests_IPHONE_5_IN_8_1_test_bundle
//components/BottomAppBar:unit_tests_IPHONE_7_PLUS_IN_10_3
//components/BottomAppBar:unit_tests_IPHONE_7_PLUS_IN_10_3_test_bundle
//components/BottomAppBar:unit_tests_IPHONE_X_IN_11_0
//components/BottomAppBar:unit_tests_IPHONE_X_IN_11_0_test_bundle
//components/ButtonBar:unit_tests
//components/ButtonBar:unit_tests_IPAD_PRO_12_9_IN_9_3
//components/ButtonBar:unit_tests_IPAD_PRO_12_9_IN_9_3_test_bundle
//components/ButtonBar:unit_tests_IPHONE_5_IN_8_1
//components/ButtonBar:unit_tests_IPHONE_5_IN_8_1_test_bundle
//components/ButtonBar:unit_tests_IPHONE_7_PLUS_IN_10_3
//components/ButtonBar:unit_tests_IPHONE_7_PLUS_IN_10_3_test_bundle
//components/ButtonBar:unit_tests_IPHONE_X_IN_11_0
//components/ButtonBar:unit_tests_IPHONE_X_IN_11_0_test_bundle
//components/Buttons:snapshot_tests
//components/Buttons:snapshot_tests_test_bundle
//components/Buttons:unit_tests
//components/Buttons:unit_tests_IPAD_PRO_12_9_IN_9_3
//components/Buttons:unit_tests_IPAD_PRO_12_9_IN_9_3_test_bundle
//components/Buttons:unit_tests_IPHONE_5_IN_8_1
//components/Buttons:unit_tests_IPHONE_5_IN_8_1_test_bundle
//components/Buttons:unit_tests_IPHONE_7_PLUS_IN_10_3
//components/Buttons:unit_tests_IPHONE_7_PLUS_IN_10_3_test_bundle
//components/Buttons:unit_tests_IPHONE_X_IN_11_0
//components/Buttons:unit_tests_IPHONE_X_IN_11_0_test_bundle
//components/Dialogs:snapshot_tests
//components/Dialogs:snapshot_tests_test_bundle
//components/Dialogs:unit_tests
//components/Dialogs:unit_tests_IPAD_PRO_12_9_IN_9_3
//components/Dialogs:unit_tests_IPAD_PRO_12_9_IN_9_3_test_bundle
//components/Dialogs:unit_tests_IPHONE_5_IN_8_1
//components/Dialogs:unit_tests_IPHONE_5_IN_8_1_test_bundle
//components/Dialogs:unit_tests_IPHONE_7_PLUS_IN_10_3
//components/Dialogs:unit_tests_IPHONE_7_PLUS_IN_10_3_test_bundle
//components/Dialogs:unit_tests_IPHONE_X_IN_11_0
//components/Dialogs:unit_tests_IPHONE_X_IN_11_0_test_bundle
//components/NavigationBar:unit_tests
//components/NavigationBar:unit_tests_IPAD_PRO_12_9_IN_9_3
//components/NavigationBar:unit_tests_IPAD_PRO_12_9_IN_9_3_test_bundle
//components/NavigationBar:unit_tests_IPHONE_5_IN_8_1
//components/NavigationBar:unit_tests_IPHONE_5_IN_8_1_test_bundle
//components/NavigationBar:unit_tests_IPHONE_7_PLUS_IN_10_3
//components/NavigationBar:unit_tests_IPHONE_7_PLUS_IN_10_3_test_bundle
//components/NavigationBar:unit_tests_IPHONE_X_IN_11_0
//components/NavigationBar:unit_tests_IPHONE_X_IN_11_0_test_bundle
//components/Snackbar:unit_tests
//components/Snackbar:unit_tests_IPAD_PRO_12_9_IN_9_3
//components/Snackbar:unit_tests_IPAD_PRO_12_9_IN_9_3_test_bundle
//components/Snackbar:unit_tests_IPHONE_5_IN_8_1
//components/Snackbar:unit_tests_IPHONE_5_IN_8_1_test_bundle
//components/Snackbar:unit_tests_IPHONE_7_PLUS_IN_10_3
//components/Snackbar:unit_tests_IPHONE_7_PLUS_IN_10_3_test_bundle
//components/Snackbar:unit_tests_IPHONE_X_IN_11_0
//components/Snackbar:unit_tests_IPHONE_X_IN_11_0_test_bundle

@romoore romoore requested a review from a team February 19, 2019 13:47
@romoore romoore marked this pull request as ready for review February 19, 2019 13:47
@material-automation
Copy link

This PR affects multiple components.

@romoore romoore merged commit 4161262 into material-components:develop Feb 19, 2019
@romoore romoore deleted the buttons-snapshot branch February 19, 2019 16:09
galiak11 added a commit to galiak11/material-components-ios that referenced this pull request Feb 19, 2019
commit 4161262
Author: Robert Moore <rsmoore@google.com>
Date:   Tue Feb 19 11:09:49 2019 -0500

    [Buttons] Add states snapshot tests. (material-components#6639)

    Simple snapshot tests for the main UIControlStates.

commit 65426c8
Author: Robert Moore <rsmoore@google.com>
Date:   Tue Feb 19 09:26:53 2019 -0500

    [Slider] Add basic snapshot tests. (material-components#6640)

    Adding a few snapshot tests to capture the basic styling/appearance of
    Sliders.

commit d77f1b3
Author: Robert Moore <rsmoore@google.com>
Date:   Tue Feb 19 09:26:25 2019 -0500

    [Dialogs] Add snapshot tests to MDCAlertController (material-components#6641)

    Adds basic snapshot tests to MDCAlertController.

    Helped identify #6637

commit fb8190d
Author: Robert Moore <rsmoore@google.com>
Date:   Tue Feb 19 09:25:57 2019 -0500

    [BottomAppBar] Add basic snapshot tests. (material-components#6643)

    Adding a few simple snapshot tests to capture the default appearance of
    the bar.

commit ecf420e
Author: Robert Moore <rsmoore@google.com>
Date:   Tue Feb 19 08:36:30 2019 -0500

    [BottomAppBar] Fix FAB location when RTL changes. (material-components#6644)

    If the `semanticContentAttribute` for an MDCBottomAppBarView changes
    during its lifetime, it won't correctly reposition the FAB. Instead of
    checking the interface layout orientation once during initialization, it
    should check every time it needs to perform layout.

    |Before|After|
    |---|---|
    |<img width="380" alt="testfloatingbuttontrailingrtl_11_2-develop" src="https://user-images.githubusercontent.com/1753199/52929433-6812c800-3312-11e9-8505-07933e1ee077.png">|<img width="380" alt="testfloatingbuttontrailingrtl_11_2 2x" src="https://user-images.githubusercontent.com/1753199/52929438-6ba64f00-3312-11e9-805f-edc2e68cf1a5.png">|

    Fixes #6642

commit 6090cd6
Author: Wenyu Zhang <8836258+wenyuzhang666@users.noreply.github.com>
Date:   Fri Feb 15 16:03:36 2019 -0500

    [MDC Dialogs] add an example for custom dialog view controller themed by theming extension (material-components#6601)

commit abec164
Author: Yarden Eitan <yar@google.com>
Date:   Fri Feb 15 15:12:14 2019 -0500

    add a11y identifier for the nav drawer scrollview (material-components#6629)

    Clients have requested access to the internal scrollview for EarlGrey testing by providing an accessibility identifier to the scrollview.

commit 7b73a03
Merge: 3b1d82a c79f7cc
Author: Randall Li <randallli@google.com>
Date:   Fri Feb 15 00:18:41 2019 -0500

    Merge branch 'release-candidate' into develop

commit c79f7cc
Author: Randall Li <randallli@google.com>
Date:   Thu Feb 14 13:47:08 2019 -0500

    fixed changlog manually based on feedback

commit e744b01
Merge: 100416a 155f278
Author: Randall Li <randallli@google.com>
Date:   Thu Feb 14 13:01:59 2019 -0500

    Merge branch 'stable' into release-candidate

commit 100416a
Author: Randall Li <randallli@google.com>
Date:   Wed Feb 13 16:32:07 2019 -0500

    manual copyedit of the changelog

commit 85d3f99
Author: Randall Li <randallli@google.com>
Date:   Wed Feb 13 13:38:03 2019 -0500

    Bumped version number to 77.0.0.

commit c786698
Author: Randall Li <randallli@google.com>
Date:   Wed Feb 13 13:36:44 2019 -0500

    Hand-modified CHANGELOG.md API diff.

commit eabf0e0
Author: Randall Li <randallli@google.com>
Date:   Wed Feb 13 12:24:15 2019 -0500

    Automatic changelog preparation for release.

commit 155f278
Merge: c77a2f8 0cf6486
Author: Ian Gordon <iangordon@google.com>
Date:   Fri Feb 8 17:08:25 2019 -0500

    Merge branch 'release-candidate' into stable
codeman7 added a commit that referenced this pull request Apr 9, 2019
## Context
As of #7087 [`MDCButton`](https://github.com/material-components/material-components-ios/tree/develop/components/Buttons) now supports [`MDCStatefulRipple`](https://github.com/material-components/material-components-ios/blob/develop/components/Ripple/src/MDCStatefulRippleView.h). This PR adds snapshot test when this behavior is enabled. This PR is a _copy_ of #6639 with a few minor modifications.

## Alternatives considered
1. Adding [EarlGrey](https://github.com/google/EarlGrey) tests. We currently don't have any earl grey test so this would be a bigger discussion with the team.

2. Mocking `UITouch` events, and calling `touchesBegan`, `touchesEnded`, `touchedCancelled`, and `touchesMoved`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants