mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
31 lines
735 B
Swift
31 lines
735 B
Swift
@testable import LayoutKit
|
|
|
|
import XCTest
|
|
|
|
import CommonCorePublic
|
|
import DivKit
|
|
|
|
final class DivTextExtensionsTests: XCTestCase {
|
|
func test_WhenDivHasAction_CreatesBlockWithIt() throws {
|
|
let block = try makeBlock(fromFile: "with_action") as? DecoratingBlock
|
|
|
|
XCTAssertEqual(block?.actions, Expected.actions)
|
|
}
|
|
|
|
func test_WhenDivHasSetStateAction_CreatesBlockWithIt() throws {
|
|
let block = try makeBlock(
|
|
fromFile: "with_set_state_action"
|
|
) as? DecoratingBlock
|
|
|
|
XCTAssertEqual(block?.actions, Expected.setStateActions)
|
|
}
|
|
}
|
|
|
|
private func makeBlock(fromFile filename: String) throws -> Block {
|
|
try DivTextTemplate.make(
|
|
fromFile: filename,
|
|
subdirectory: "div-text",
|
|
context: .default
|
|
)
|
|
}
|