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