We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 431863a commit 8b197c5Copy full SHA for 8b197c5
iOS_SDK/OneSignalSDK/UnitTests/LanguageTest.m
@@ -89,4 +89,22 @@ -(void)testSetLanguage_afterOnSession {
89
XCTAssertEqualObjects(OneSignalClientOverrider.lastHTTPRequest[@"language"], @"fr");
90
}
91
92
+- (void)testEmptyLanguage {
93
+ [UnitTestCommonMethods initOneSignal_andThreadWait];
94
+
95
+ let expectation = [self expectationWithDescription:@"language"];
96
+ expectation.expectedFulfillmentCount = 1;
97
98
+ [OneSignal setLanguage:@"" withSuccess:^{
99
+ XCTFail(@"setLanguage: should reject invalid languages");
100
101
+ } withFailure:^(NSError *error) {
102
+ XCTAssertNotNil(error);
103
104
+ [expectation fulfill];
105
+ }];
106
107
+ [self waitForExpectations:@[expectation] timeout:1];
108
+}
109
110
@end
0 commit comments