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

πŸ’²[Native Checkout] Pledge Error State CTA #753

Merged
merged 84 commits into from
Jul 23, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
05bbd8a
wip project states
cdolm92 May 10, 2019
92a772f
wip project states button colors and label showing up
cdolm92 May 13, 2019
ea877dd
wip project states button height fix
cdolm92 May 13, 2019
6d683dc
wip, manage button
cdolm92 May 15, 2019
15e074f
wip setting up vm for states
cdolm92 May 15, 2019
4d7e56c
wip setting up vm for states
cdolm92 May 16, 2019
dd9ec41
wip for reward title in manage state
cdolm92 May 16, 2019
eefe409
wip - refactor and vm tests
cdolm92 May 20, 2019
fe5f0d3
Merge branch 'feature-native-checkout' of https://github.com/kickstar…
cdolm92 May 20, 2019
03efd50
wip - getting reward title now
cdolm92 May 22, 2019
cced1e6
wip - amount and reward formatted for manage state
cdolm92 Jun 4, 2019
64a8d49
wip
cdolm92 Jun 4, 2019
17563db
wip- deleted backer banner
cdolm92 Jun 10, 2019
b20e616
wip- swiftlint fixes
cdolm92 Jun 10, 2019
a99489e
Merge branch 'feature-native-checkout' of https://github.com/kickstar…
cdolm92 Jun 10, 2019
5d34bc2
wip - got view layer back
cdolm92 Jun 11, 2019
fd1bfdd
wip - refactor and renaming
cdolm92 Jun 13, 2019
7b583df
wip - snapshot tests
cdolm92 Jun 13, 2019
e29225f
wip
cdolm92 Jun 17, 2019
70db98a
wip- corrected shipping amount in manage state
cdolm92 Jun 17, 2019
026c304
wip- final and alphabetize files
cdolm92 Jun 17, 2019
86fb7d2
Merge branch 'feature-native-checkout' of https://github.com/kickstar…
cdolm92 Jun 17, 2019
6e3b73a
pr feedback -move stylings to bindStyles()
cdolm92 Jun 18, 2019
9eea1a9
smapshot tests
cdolm92 Jun 18, 2019
3f643b4
manage and view rewards strings added
cdolm92 Jun 18, 2019
3e4e464
using new strings
cdolm92 Jun 18, 2019
cde68d2
vm tests fix
cdolm92 Jun 18, 2019
db15830
swift format
cdolm92 Jun 18, 2019
cbd9ad3
wip- fix pledge
cdolm92 Jun 19, 2019
c881491
revert strings
cdolm92 Jun 20, 2019
0257061
backer banner is back
cdolm92 Jun 20, 2019
b719a30
snapshots
cdolm92 Jun 20, 2019
cc391cc
refactor- was not using user
cdolm92 Jun 20, 2019
dd4581a
light refactor
cdolm92 Jun 20, 2019
0127edb
refactor and snapshot test correction
cdolm92 Jun 20, 2019
838dc60
swiftlint fix
cdolm92 Jun 20, 2019
c00e4a5
new snapshots
cdolm92 Jun 20, 2019
8cce6f9
remove images from new snapshots
cdolm92 Jun 20, 2019
53e9290
remove image
cdolm92 Jun 20, 2019
3be29bc
Merge branch 'cta-project-states' of https://github.com/kickstarter/i…
cdolm92 Jun 20, 2019
3a48577
wip - fix state
cdolm92 Jun 20, 2019
a44d702
case
cdolm92 Jun 25, 2019
e86d42f
fix logic is there
cdolm92 Jun 27, 2019
24b00d6
fix vm tests are passing
cdolm92 Jun 27, 2019
cd4a326
Merge branch 'feature-native-checkout' of https://github.com/kickstar…
cdolm92 Jul 9, 2019
ca08db7
snapshot tests fixed
cdolm92 Jul 9, 2019
c092f74
snapshot tests fix for error state
cdolm92 Jul 9, 2019
c686804
strings for error state
cdolm92 Jul 9, 2019
f151c39
vm refactor
cdolm92 Jul 9, 2019
e597ac6
vm refactor title text
cdolm92 Jul 9, 2019
b06feec
undid change
cdolm92 Jul 9, 2019
6bc920e
swift format
cdolm92 Jul 9, 2019
425270a
fix button width
cdolm92 Jul 10, 2019
013d3a5
new snapshots
cdolm92 Jul 10, 2019
7f59096
design feedback, new snapshots
cdolm92 Jul 11, 2019
7e8da8d
swift format
cdolm92 Jul 11, 2019
01f8a61
added spacing
cdolm92 Jul 11, 2019
5479451
renamed a stackview
cdolm92 Jul 11, 2019
e48bfd3
capitalized
cdolm92 Jul 11, 2019
8d4a673
capitalized
cdolm92 Jul 11, 2019
0e6df1c
fixes
cdolm92 Jul 11, 2019
f102379
Merge branch 'feature-native-checkout' of https://github.com/kickstar…
ifbarrera Jul 11, 2019
3557bef
Cleaning up screenshots, fixing issues with merge conflict
ifbarrera Jul 11, 2019
5bc65dd
Formatting
ifbarrera Jul 11, 2019
7364ab2
Revert unneeded project template
ifbarrera Jul 11, 2019
1933e08
Cleaning up the snapshot configurations so they’re more consistent fr…
ifbarrera Jul 11, 2019
4978002
Formatting
ifbarrera Jul 11, 2019
3045c43
Line length
ifbarrera Jul 11, 2019
82cd0cb
Line length again
ifbarrera Jul 11, 2019
8a9f3ca
Merge branch 'cta-error-pledge-state' of https://github.com/kickstart…
cdolm92 Jul 15, 2019
c0f25d7
new snapshots
cdolm92 Jul 15, 2019
b00d851
requested changes
cdolm92 Jul 18, 2019
3cf816e
fixed reward title missing
cdolm92 Jul 18, 2019
f973a8c
fixed snapshot failures
cdolm92 Jul 22, 2019
3df1286
new snapshots
cdolm92 Jul 22, 2019
e5b8f24
swift format
cdolm92 Jul 22, 2019
8917e53
swift lint fix
cdolm92 Jul 22, 2019
a865187
Merge branch 'feature-native-checkout' of https://github.com/kickstar…
cdolm92 Jul 22, 2019
7c7678e
swift format
cdolm92 Jul 22, 2019
302860f
pr feedback and snapshot test for error state
cdolm92 Jul 22, 2019
8e52e12
name change to minHeight and minWidth
cdolm92 Jul 22, 2019
a88c6ed
snapshot tests for error state
cdolm92 Jul 22, 2019
577fb91
constant name change
cdolm92 Jul 23, 2019
ecb2745
snapshot correction
cdolm92 Jul 23, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,38 @@ internal final class ProjectPamphletViewControllerTests: TestCase {
}
}

func testLoggedIn_Backer_LiveProject_Error_NativeCheckout_Enabled() {
let config = Config.template
|> \.features .~ [Feature.checkout.rawValue: true]
let currentUser = User.template
let backing = Backing.template
|> Backing.lens.status .~ .errored
let backedProject = Project.cosmicSurgery
|> Project.lens.photo.full .~ ""
|> Project.lens.personalization.isBacking .~ true
|> Project.lens.personalization.backing .~ backing
|> Project.lens.state .~ .live

[Device.phone4inch, Device.phone5_5inch, Device.phone5_8inch].forEach { device in
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use combos(Language.allLanguages, Device.allCases) so it's consistent with the rest of the tests in this file? I know it generates tons of screenshots, but this is a high-value piece of UI that would be useful to have fully covered in all languages and screens sizes

let language = Language.en
withEnvironment(
apiService: MockService(fetchProjectResponse: backedProject),
config: config, currentUser: currentUser, language: language
) {
let vc = ProjectPamphletViewController.configuredWith(
projectOrParam: .left(backedProject), refTag: nil
)

let (parent, _) = traitControllers(device: device, orientation: .portrait, child: vc)
parent.view.frame.size.height = device == .pad ? 1_200 : parent.view.frame.size.height

scheduler.run()

FBSnapshotVerifyView(vc.view, identifier: "lang_\(language)_device_\(device)", tolerance: 0.01)
}
}
}

func testLoggedIn_NonBacker_NonLiveProject_NativeCheckout_Enabled() {
let config = Config.template
|> \.features .~ [Feature.checkout.rawValue: true]
Expand Down
8 changes: 4 additions & 4 deletions Kickstarter-iOS/Views/PledgeCTAContainerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import UIKit

private enum Layout {
enum Button {
static let height: CGFloat = 48.0
static let width: CGFloat = 98.0
static let minHeight: CGFloat = 48.0
static let minWidth: CGFloat = 98.0
}
}

Expand Down Expand Up @@ -54,8 +54,8 @@ final class PledgeCTAContainerView: UIView {
|> ksr_addArrangedSubviewsToStackView()

NSLayoutConstraint.activate([
self.pledgeCTAButton.heightAnchor.constraint(greaterThanOrEqualToConstant: Layout.Button.height),
self.pledgeCTAButton.widthAnchor.constraint(greaterThanOrEqualToConstant: Layout.Button.width),
self.pledgeCTAButton.heightAnchor.constraint(greaterThanOrEqualToConstant: Layout.Button.minHeight),
self.pledgeCTAButton.widthAnchor.constraint(greaterThanOrEqualToConstant: Layout.Button.minWidth),
self.rootStackView.topAnchor.constraint(equalTo: self.layoutMarginsGuide.topAnchor)
])

Expand Down
2 changes: 1 addition & 1 deletion Library/ViewModels/ProjectPamphletViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public final class ProjectPamphletViewModel: ProjectPamphletViewModelType, Proje
}

let project = freshProjectAndRefTag
.map { project, _ in project }
.map(first)

self.configurePledgeCTAView = project
.skip(first: 1)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.