diff options
author | Justin Beharry <justin.beharry@livio.io> | 2022-08-08 14:44:22 -0400 |
---|---|---|
committer | Justin Beharry <justin.beharry@livio.io> | 2022-08-08 14:44:22 -0400 |
commit | 98d21ab41ea5c9fd232db23c43c6c7e48a424b2f (patch) | |
tree | 689a9bd61b089f53cd17e17011c11afd6b9eaad7 /SmartDeviceLinkTests/DevAPISpecs | |
parent | 13604e54a58396d530896516b211f290a05e127b (diff) | |
download | sdl_ios-98d21ab41ea5c9fd232db23c43c6c7e48a424b2f.tar.gz |
Test for copied submenu cell id
Diffstat (limited to 'SmartDeviceLinkTests/DevAPISpecs')
-rw-r--r-- | SmartDeviceLinkTests/DevAPISpecs/SDLMenuManagerSpec.m | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLMenuManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLMenuManagerSpec.m index c0c489754..1ee9d5afd 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLMenuManagerSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLMenuManagerSpec.m @@ -6,6 +6,7 @@ #import "SDLGlobals.h" #import "SDLMenuManager.h" +#import "SDLMenuShowOperation.h" #import "SDLMenuReplaceOperation.h" #import "TestConnectionManager.h" @@ -17,6 +18,12 @@ @end +@interface SDLMenuShowOperation() + +@property (strong, nonatomic, nullable) SDLMenuCell *submenuCell; + +@end + @interface SDLMenuManager() @property (weak, nonatomic) id<SDLConnectionManagerType> connectionManager; @@ -270,12 +277,17 @@ describe(@"menu manager", ^{ }); // should queue an open menu operation for a copied submenu cell - it(@"should queue an open menu operation for a copied submenu cell", ^ { + it(@"should queue an open menu operation for a copied submenu cell and match the original cell id", ^ { + submenuCell.cellId = 1; testManager.menuCells = @[submenuCell]; + SDLMenuCell *copiedCell = [[SDLMenuCell alloc] initWithTitle:@"Test 3" secondaryText:nil tertiaryText:nil icon:nil secondaryArtwork:nil submenuLayout:nil subCells:@[textOnlyCell]]; BOOL canSendRPC = [testManager openMenu:copiedCell]; - + SDLMenuShowOperation *showOperation = (SDLMenuShowOperation *)testManager.transactionQueue.operations[1]; + + expect(showOperation.submenuCell.cellId).to(equal(submenuCell.cellId)); + expect(showOperation.submenuCell.cellId).toNot(equal(copiedCell.cellId)); expect(testManager.transactionQueue.operationCount).to(equal(2)); expect(canSendRPC).to(equal(YES)); }); |