Skip to content

Commit

Permalink
Fix an issue with vertical sizing introduced by the prev change
Browse files Browse the repository at this point in the history
  • Loading branch information
aleh committed Sep 16, 2024
1 parent a84dcc8 commit 0f9464b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion MMMTestCase.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
4 changes: 2 additions & 2 deletions Sources/MMMTestCaseObjC/MMMTestCase.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -115,7 +115,7 @@ typedef NS_ENUM(NSInteger, MMMTestCaseFit) {
- (void)varyParameters:(NSDictionary<NSString *, NSDictionary<NSString *, id> *> *)parameters
block:(void (^)(NSString *combinationIdentifier, NSDictionary<NSString *, id> *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
Expand Down
6 changes: 3 additions & 3 deletions Sources/MMMTestCaseObjC/MMMTestCase.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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];
Expand Down

0 comments on commit 0f9464b

Please sign in to comment.