File tree Expand file tree Collapse file tree 2 files changed +12
-11
lines changed
example/ios/InstabugTests Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -612,21 +612,19 @@ - (void)testisW3CFeatureFlagsEnabled {
612
612
}
613
613
614
614
- (void )testGetNetworkBodyMaxSize {
615
- id mock = OCMClassMock ([IBGNetworkLogger class ]);
616
615
double expectedValue = 10240.0 ;
616
+ XCTestExpectation *expectation = [self expectationWithDescription: @" Call completion handler" ];
617
+
618
+ OCMStub ([self .mNetworkLogger getNetworkBodyMaxSize ]).andReturn (expectedValue);
617
619
618
- OCMStub ([mock getNetworkBodyMaxSize ]).andReturn (expectedValue);
619
-
620
- XCTestExpectation *expectation = [self expectationWithDescription: @" Call resolve block" ];
621
- RCTPromiseResolveBlock resolve = ^(NSNumber *result) {
622
- XCTAssertEqual (result.doubleValue , expectedValue);
620
+ [self .api getNetworkBodyMaxSizeWithCompletion: ^(NSNumber *actual, FlutterError *error) {
623
621
[expectation fulfill ];
624
- };
625
-
626
- [self .instabugBridge getNetworkBodyMaxSize: resolve :nil ];
627
- [self waitForExpectationsWithTimeout: 1.0 handler: nil ];
622
+ XCTAssertEqual (actual.doubleValue , expectedValue);
623
+ XCTAssertNil (error);
624
+ }];
628
625
629
- OCMVerify (ClassMethod ([mock getNetworkBodyMaxSize ]));
626
+ OCMVerify ([self .mNetworkLogger getNetworkBodyMaxSize ]);
627
+ [self waitForExpectations: @[expectation] timeout: 5.0 ];
630
628
}
631
629
632
630
@end
Original file line number Diff line number Diff line change @@ -78,6 +78,9 @@ void main() {
78
78
"isW3cCaughtHeaderEnabled" : true ,
79
79
}),
80
80
);
81
+ when (mHost.getNetworkBodyMaxSize ()).thenAnswer (
82
+ (_) => Future .value (10240 ),
83
+ );
81
84
await Instabug .init (
82
85
token: token,
83
86
invocationEvents: events,
You can’t perform that action at this time.
0 commit comments