mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
22 lines
649 B
Swift
22 lines
649 B
Swift
import XCTest
|
|
|
|
import CommonCorePublic
|
|
import LayoutKit
|
|
|
|
final class ContainerBlockTests: XCTestCase {
|
|
func test_WhenUpdatesState_SendsStatesToChildren() throws {
|
|
let state = GalleryViewState(contentOffset: 1, itemsCount: 2)
|
|
let states = [GalleryBlockTestModels.path: state]
|
|
let block = containerBlock
|
|
|
|
let updatedBlock = try block.updated(withStates: states)
|
|
let updatedGalleryBlock = updatedBlock.children.first?.content as? GalleryBlock
|
|
XCTAssertEqual(updatedGalleryBlock?.state, state)
|
|
}
|
|
}
|
|
|
|
private let containerBlock = try! ContainerBlock(
|
|
layoutDirection: .horizontal,
|
|
children: [GalleryBlockTestModels.base]
|
|
)
|