Files
divkit/client/ios/LayoutKit/LayoutKitTests/Blocks/ContainerBlockTests.swift
T
2023-03-28 12:17:21 +03:00

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]
)