1
0
mirror of https://github.com/Toxblh/MTMR.git synced 2026-01-10 00:58:37 +00:00

Readd test for legacyAction

This commit is contained in:
Matteo Piccina 2020-07-31 13:37:04 +02:00
parent f5a2259333
commit 3e707e9bca

View File

@ -30,6 +30,21 @@ class ParseConfig: XCTestCase {
return
}
}
func testButtonKeyCodeLegacyAction() {
let buttonKeycodeFixture = """
[ { "type": "staticButton", "title": "Pew", "action": "hidKey", "keycode": 123 } ]
""".data(using: .utf8)!
let result = try? JSONDecoder().decode([BarItemDefinition].self, from: buttonKeycodeFixture)
guard case .staticButton("Pew")? = result?.first?.type else {
XCTFail()
return
}
guard case .hidKey(keycode: 123)? = result?.first?.legacyAction else {
XCTFail()
return
}
}
func testPredefinedItem() {
let buttonKeycodeFixture = """