mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
39 lines
845 B
Swift
39 lines
845 B
Swift
import CoreGraphics
|
|
import LayoutKit
|
|
import VGSL
|
|
|
|
final class TooltipFactorySnapshotTests: LayoutKitSnapshotTest {
|
|
func test_Orientations() {
|
|
for item in BlockTooltip.Position.allCases {
|
|
perform(text: "Тултип", position: item, width: nil)
|
|
}
|
|
}
|
|
|
|
func test_Multiline() {
|
|
perform(
|
|
text: "Много текста, который не поместится в одну строку",
|
|
position: .topRight,
|
|
width: 90
|
|
)
|
|
}
|
|
|
|
private func perform(
|
|
text: String,
|
|
position: BlockTooltip.Position,
|
|
width: CGFloat?,
|
|
name: String = #function
|
|
) {
|
|
let block = TooltipFactory.makeTooltip(
|
|
text: text,
|
|
position: position,
|
|
width: width
|
|
)
|
|
perform(
|
|
on: block,
|
|
size: block.intrinsicSize,
|
|
name: "\(name)_\(position)",
|
|
mode: .verify
|
|
)
|
|
}
|
|
}
|