Skip to content

Commit fac5413

Browse files
committed
Fixing pr
1 parent d64c109 commit fac5413

9 files changed

Lines changed: 24 additions & 11 deletions

e2e/Modals.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ describe('modal', () => {
2626
await elementById(TestIDs.MODAL_LIFECYCLE_BTN).tap();
2727
await expect(elementByLabel('didAppear')).toBeVisible();
2828
await elementById(TestIDs.DISMISS_MODAL_BTN).tap();
29-
await waitFor(elementByLabel('componentWillUnmount')).toBeVisible().withTimeout(1000);
29+
await expect(elementByLabel('componentWillUnmount')).toBeVisible();
3030
await elementByLabel('OK').atIndex(0).tap();
31-
await waitFor(elementByLabel('didDisappear')).toBeVisible().withTimeout(1000);
31+
await expect(elementByLabel('didDisappear')).toBeVisible();
3232
await elementByLabel('OK').atIndex(0).tap();
3333
});
3434

@@ -148,9 +148,9 @@ describe('modal', () => {
148148
await elementById(TestIDs.MODAL_COMMANDS_BTN).tap();
149149
await elementById(TestIDs.MODAL_BTN).tap();
150150

151-
await waitFor(elementByLabel('showModal promise resolved with: UniqueStackId')).toBeVisible().withTimeout(1000);
152-
await waitFor(elementByLabel('modalDismissed listener called with with: UniqueStackId')).toBeVisible().withTimeout(1000);
153-
await waitFor(elementByLabel('dismissModal promise resolved with: UniqueStackId')).toBeVisible().withTimeout(1000);
151+
await expect(elementByLabel('showModal promise resolved with: UniqueStackId')).toBeVisible();
152+
await expect(elementByLabel('modalDismissed listener called with with: UniqueStackId')).toBeVisible();
153+
await expect(elementByLabel('dismissModal promise resolved with: UniqueStackId')).toBeVisible();
154154
});
155155

156156
it.e2e('should show declared modal', async () => {

e2e/Stack.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ describe('Stack', () => {
134134
it.e2e('unmount is called on pop', async () => {
135135
await elementById(TestIDs.PUSH_LIFECYCLE_BTN).tap();
136136
await elementById(TestIDs.POP_BTN).tap();
137-
await waitFor(elementByLabel('componentWillUnmount')).toBeVisible().withTimeout(1000);
137+
await expect(elementByLabel('componentWillUnmount')).toBeVisible();
138138
await elementByLabel('OK').atIndex(0).tap();
139139
await expect(elementByLabel('didDisappear')).toBeVisible();
140140
});
@@ -179,7 +179,7 @@ describe('Stack', () => {
179179
it.e2e('push promise is resolved with pushed ViewController id', async () => {
180180
await elementById(TestIDs.STACK_COMMANDS_BTN).tap();
181181
await elementById(TestIDs.PUSH_BTN).tap();
182-
await waitFor(elementByLabel('push promise resolved with: ChildId')).toBeVisible().withTimeout(1000);
182+
await expect(elementByLabel('push promise resolved with: ChildId')).toBeVisible();
183183
await expect(elementByLabel('pop promise resolved with: ChildId')).toBeVisible();
184184
});
185185

e2e/StaticLifecycleEvents.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ describe('static lifecycle events', () => {
1010
await elementById(TestIDs.SHOW_STATIC_EVENTS_SCREEN).tap();
1111
await elementById(TestIDs.STATIC_EVENTS_OVERLAY_BTN).tap();
1212
await expect(elementByLabel('Static Lifecycle Events Overlay')).toBeVisible();
13+
await expect(elementByLabel('componentWillAppear | EventsOverlay | Component')).toBeVisible();
1314
await expect(elementByLabel('componentDidAppear | EventsOverlay | Component')).toBeVisible();
1415
await elementById(TestIDs.CLEAR_OVERLAY_EVENTS_BTN).tap();
1516
});

lib/ios/AnimatedTextView.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ - (void)layoutSubviews {
4545

4646
- (void)reset {
4747
[super reset];
48+
_fromTextContainer.size = _fromSize;
4849
}
4950

5051
- (NSTextContainer *)container:(NSTextStorage *)fromTextStorage {

lib/ios/RNNCommandsHandler.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ - (void)pop:(NSString *)componentId
300300
completion:^{
301301
[self->_eventEmitter sendOnNavigationCommandCompletion:pop
302302
commandId:commandId];
303+
NSLog(@"Pop commandshandler completed");
303304
completion();
304305
}
305306
rejection:rejection];

lib/ios/RNNCustomTitleView.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#ifdef RCT_NEW_ARCH_ENABLED
66
#import <React/RCTSurfaceDelegate.h>
7+
#import <React/RCTSurface.h>
78
#endif
89

910
@interface RNNCustomTitleView : UIView <

lib/ios/RNNCustomTitleView.mm

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,15 @@ - (NSString *)alignment {
5555

5656
#ifdef RCT_NEW_ARCH_ENABLED
5757
- (void)surface:(RCTSurface *)surface didChangeIntrinsicSize:(CGSize)intrinsicSize {
58-
// TODO: FILL WITH DATA
58+
if ([self.alignment isEqualToString:@"center"]) {
59+
[self setFrame:CGRectMake(self.frame.origin.x, self.frame.origin.y,
60+
self.subView.intrinsicContentSize.width,
61+
self.subView.intrinsicContentSize.height)];
62+
[self.subView setFrame:CGRectMake(0, 0, surface.intrinsicSize.width,
63+
surface.intrinsicSize.height)];
64+
}
5965
}
66+
6067
#else
6168
- (void)rootViewDidChangeIntrinsicSize:(RCTRootView *)rootView {
6269
if ([self.alignment isEqualToString:@"center"]) {

lib/ios/UINavigationController+RNNCommands.mm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ - (void)push:(UIViewController *)newTop
2121

2222
[self
2323
performBlock:^{
24+
NSLog(@"About to push a controller %@", newTop);
2425
[self pushViewController:newTop animated:animated];
2526
}
2627
animated:animated
@@ -38,9 +39,12 @@ - (void)popAnimated:(BOOL)animated
3839
}
3940
animated:animated
4041
completion:^{
42+
NSLog(@"Pop popAnimated completed");
4143
if (poppedVC) {
44+
NSLog(@"Pop popAnimated completion invokation");
4245
completion();
4346
} else {
47+
NSLog(@"Pop rejection");
4448
[RNNErrorHandler reject:rejection
4549
withErrorCode:1012
4650
errorDescription:@"popping component failed"];

playground/src/screens/StackCommandsScreen.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,8 @@ export default class StackCommandsScreen extends NavigationComponent<NavigationP
4747
this.setState({
4848
pushPromiseResult: `push promise resolved with: ${pushId}`,
4949
});
50-
return 'ChildId';
50+
return Navigation.pop('ChildId');
5151
})
52-
.then((popId) => new Promise<string>((resolve) => setTimeout(() => resolve(popId), 500)))
53-
.then((popId) => Navigation.pop(popId))
5452
.then((popId) => {
5553
this.setState({
5654
popPromiseResult: `pop promise resolved with: ${popId}`,

0 commit comments

Comments
 (0)