summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2020-03-03 16:02:58 -0500
committerJoel Fischer <joeljfischer@gmail.com>2020-03-03 16:02:58 -0500
commitdd80cc10e208b2deba407b03f1d121fdc28fb6ad (patch)
treefe304b2159dfdfb68c8a143d496226f956f3195c
parentab6d468cf289929435983cf478cecc4ab9a3da11 (diff)
downloadsdl_ios-dd80cc10e208b2deba407b03f1d121fdc28fb6ad.tar.gz
Add additional tests
* Add test for setting media track and title in TextAndGraphicManager
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLTextAndGraphicManagerSpec.m25
1 files changed, 25 insertions, 0 deletions
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLTextAndGraphicManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLTextAndGraphicManagerSpec.m
index d6ba4b66b..3bbcb62fa 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLTextAndGraphicManagerSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLTextAndGraphicManagerSpec.m
@@ -469,6 +469,31 @@ describe(@"text and graphic manager", ^{
expect(testManager.inProgressUpdate.mainField2).to(beEmpty());
expect(testManager.inProgressUpdate.metadataTags.mainField2).to(beNil());
});
+
+ context(@"when media track and title are available", ^{
+ beforeEach(^{
+ NSMutableArray<SDLTextField *> *existingFieldsMutable = [testManager.windowCapability.textFields mutableCopy];
+ SDLTextField *mediaTrack = [[SDLTextField alloc] init];
+ mediaTrack.name = SDLTextFieldNameMediaTrack;
+ [existingFieldsMutable addObject:mediaTrack];
+
+ SDLTextField *title = [[SDLTextField alloc] init];
+ title.name = SDLTextFieldNameTemplateTitle;
+ [existingFieldsMutable addObject:title];
+ testManager.windowCapability.textFields = [existingFieldsMutable copy];
+ });
+
+ it(@"should set media track and title properly", ^{
+ testManager.mediaTrackTextField = textMediaTrack;
+ testManager.title = textTitle;
+
+ testManager.batchUpdates = NO;
+ [testManager updateWithCompletionHandler:nil];
+
+ expect(testManager.inProgressUpdate.mediaTrack).to(equal(textMediaTrack));
+ expect(testManager.inProgressUpdate.templateTitle).to(equal(textTitle));
+ });
+ });
});
context(@"with two lines available", ^{