forked from microsoft/AdaptiveCards
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mac]Fixed bug with associated inputs in show card (#406)
* Fixed bug with associated inputs in show card * Added test json * Updated pbxproj file
- Loading branch information
Showing
4 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
...ce/macos/ADCMacOSVisualizer/ADCMacOSVisualizer/samples/AssociatedInputNoneInShowCard.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"type": "AdaptiveCard", | ||
"$schema": "http:\/\/adaptivecards.io\/schemas\/adaptive-card.json", | ||
"version": "1.3", | ||
"body": [ | ||
{ | ||
"type": "ActionSet", | ||
"actions": [ | ||
{ | ||
"type": "Action.Submit", | ||
"title": "Submit", | ||
"data": { | ||
"wbm_command": "help" | ||
}, | ||
"associatedInputs": "none" | ||
}, | ||
{ | ||
"type": "Action.ShowCard", | ||
"title": "Action.ShowCard", | ||
"card": { | ||
"type": "AdaptiveCard", | ||
"body": [ | ||
{ | ||
"type": "ActionSet", | ||
"actions": [ | ||
{ | ||
"type": "Action.Submit", | ||
"title": "Submit", | ||
"data": { | ||
"wbm_command": "help" | ||
}, | ||
"associatedInputs": "none" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
source/macos/AdaptiveCards/AdaptiveCardsTests/Renderers/AdaptiveCardRendererTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// AdaptiveCardRendererTests.swift | ||
// AdaptiveCardsTests | ||
// | ||
// Created by mukuagar on 13/12/23. | ||
// | ||
|
||
@testable import AdaptiveCards | ||
import AdaptiveCards_bridge | ||
import XCTest | ||
|
||
class AdaptiveCardRendererTests: XCTestCase { | ||
private var hostConfig: FakeHostConfig! | ||
private var adaptiveCardRenderer: AdaptiveCardRenderer! | ||
private var rootView: FakeRootView! | ||
|
||
override func setUpWithError() throws { | ||
try super.setUpWithError() | ||
hostConfig = .make() | ||
adaptiveCardRenderer = AdaptiveCardRenderer() | ||
rootView = FakeRootView() | ||
} | ||
|
||
func testShowCardIdSameAsParent() { | ||
let parentView = FakeRootView() | ||
parentView.identifier = NSUserInterfaceItemIdentifier("test") | ||
let fakeShowCard = FakeAdaptiveCard.make() | ||
let showCardView = adaptiveCardRenderer.renderShowCard(fakeShowCard, with: hostConfig, parent: parentView, config: .default) | ||
XCTAssertEqual(parentView.identifier, showCardView.identifier) | ||
XCTAssertEqual(showCardView.identifier?.rawValue, "test") | ||
} | ||
|
||
} | ||
|