From 0f9464b3b93d5a1fb283159119460fdabcc10aa1 Mon Sep 17 00:00:00 2001 From: Aleh Dzenisiuk Date: Mon, 16 Sep 2024 13:22:09 +0200 Subject: [PATCH] Fix an issue with vertical sizing introduced by the prev change --- MMMTestCase.podspec | 2 +- Sources/MMMTestCaseObjC/MMMTestCase.h | 4 ++-- Sources/MMMTestCaseObjC/MMMTestCase.m | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/MMMTestCase.podspec b/MMMTestCase.podspec index 153943b..a7b3567 100644 --- a/MMMTestCase.podspec +++ b/MMMTestCase.podspec @@ -6,7 +6,7 @@ Pod::Spec.new do |s| s.name = "MMMTestCase" - s.version = "1.12.0" + s.version = "1.12.1" s.summary = "Our helpers for FBTestCase and XCTestCase" s.description = s.summary s.homepage = "https://github.com/mediamonks/#{s.name}" diff --git a/Sources/MMMTestCaseObjC/MMMTestCase.h b/Sources/MMMTestCaseObjC/MMMTestCase.h index 76307bd..1d43bbe 100644 --- a/Sources/MMMTestCaseObjC/MMMTestCase.h +++ b/Sources/MMMTestCaseObjC/MMMTestCase.h @@ -35,7 +35,7 @@ typedef NS_ENUM(NSInteger, MMMTestCaseFit) { @interface MMMTestCase : FBSnapshotTestCase /** - * If this is YES, then `recordMode` property will be overriden to YES for all the descendants of MMMTestCase. + * If this is YES, then `recordMode` property will be overridden to YES for all the descendants of MMMTestCase. * * This is handy when you need to re-record all the snapshot-based unit tests without tweaking `recordMode` property * of each case. @@ -115,7 +115,7 @@ typedef NS_ENUM(NSInteger, MMMTestCaseFit) { - (void)varyParameters:(NSDictionary *> *)parameters block:(void (^)(NSString *combinationIdentifier, NSDictionary *values))block; -typedef void (^RandomOrderBlock)(); +typedef void (^RandomOrderBlock)(void); /** * The order in which properties of an object are accessed should not matter, however sometimes the code is not ready diff --git a/Sources/MMMTestCaseObjC/MMMTestCase.m b/Sources/MMMTestCaseObjC/MMMTestCase.m index b36c5a4..866ea8c 100644 --- a/Sources/MMMTestCaseObjC/MMMTestCase.m +++ b/Sources/MMMTestCaseObjC/MMMTestCase.m @@ -566,7 +566,7 @@ - (void)verifyView:(UIView *)view fitSize:(CGSize)fitSize identifier:(NSString * ]; widthConstraint.priority = (fitSize.width <= 0) ? UILayoutPriorityFittingSizeLevel : UILayoutPriorityRequired; NSLayoutConstraint *heightConstraint = [NSLayoutConstraint - constraintWithItem:view attribute:NSLayoutAttributeWidth + constraintWithItem:view attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1 constant:fitSize.height <= 0 ? 0 : fitSize.height @@ -578,9 +578,9 @@ - (void)verifyView:(UIView *)view fitSize:(CGSize)fitSize identifier:(NSString * // This should call those pending layoutIfNeeded, multiple times if needed. [self pumpRunLoopABit]; - [NSLayoutConstraint deactivateConstraints:@[widthConstraint, heightConstraint]]; - size = view.bounds.size; + + [NSLayoutConstraint deactivateConstraints:@[widthConstraint, heightConstraint]]; } [outerContainer setChildView:view size:size];