summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2022-09-22 13:41:13 -0400
committerJoel Fischer <joeljfischer@gmail.com>2022-09-22 13:41:13 -0400
commit7006978924b83a74fb5f7b79c1b0fb8ea705918b (patch)
treec52332c5a9b5999e19ef9f06a24bdee42a73668c
parent69befcb68abb3226f39c627a9355eb8fda2ac1dd (diff)
downloadsdl_ios-7006978924b83a74fb5f7b79c1b0fb8ea705918b.tar.gz
2109 - Add a test for static icon
* Static icon test ensures that it's marked as uploaded and added to RPC
-rw-r--r--SmartDeviceLinkTests/SDLPresentAlertOperationSpec.m19
1 files changed, 19 insertions, 0 deletions
diff --git a/SmartDeviceLinkTests/SDLPresentAlertOperationSpec.m b/SmartDeviceLinkTests/SDLPresentAlertOperationSpec.m
index 06a3efbd7..2bde0053d 100644
--- a/SmartDeviceLinkTests/SDLPresentAlertOperationSpec.m
+++ b/SmartDeviceLinkTests/SDLPresentAlertOperationSpec.m
@@ -636,6 +636,25 @@ describe(@"SDLPresentAlertOperation", ^{
OCMVerifyAll(strictMockSystemCapabilityManager);
OCMVerifyAll(strictMockCurrentWindowCapability);
});
+
+ fit(@"should not upload the image if the alert icon is a static icon", ^{
+ SDLAlertView *alertView = [[SDLAlertView alloc] initWithText:@"Test" secondaryText:nil tertiaryText:nil timeout:nil showWaitIndicator:nil audioIndication:nil buttons:nil icon:[SDLArtwork artworkWithStaticIcon:SDLStaticIconNameKey]];
+ testPresentAlertOperation = [[SDLPresentAlertOperation alloc] initWithConnectionManager:mockConnectionManager fileManager:strictMockFileManager systemCapabilityManager:strictMockSystemCapabilityManager currentWindowCapability:strictMockCurrentWindowCapability alertView:alertView cancelID:testCancelID];
+
+ OCMStub([strictMockCurrentWindowCapability hasImageFieldOfName:SDLImageFieldNameAlertIcon]).andReturn(YES);
+ OCMStub([strictMockFileManager hasUploadedFile:[OCMArg any]]).andReturn(NO);
+ OCMStub([strictMockFileManager fileNeedsUpload:[OCMArg any]]).andReturn(NO);
+
+ OCMReject([strictMockFileManager uploadArtworks:[OCMArg any] progressHandler:[OCMArg any] completionHandler:[OCMArg any]]);
+
+ [testPresentAlertOperation start];
+
+ OCMVerifyAll(strictMockFileManager);
+ OCMVerifyAll(strictMockSystemCapabilityManager);
+ OCMVerifyAll(strictMockCurrentWindowCapability);
+ expect(testPresentAlertOperation.alertIconUploaded).to(beTrue());
+ expect(testPresentAlertOperation.alertRPC.alertIcon).toNot(beNil());
+ });
});
});