mirror of
https://github.com/ichmagmaus111/ghostgram.git
synced 2026-11-03 22:27:13 +01:00
Ghostgram for iOS, rebuilt from scratch on Telegram iOS 13.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
21 lines
820 B
Swift
21 lines
820 B
Swift
#if canImport(UIKit)
|
|
import XCTest
|
|
import UIKit
|
|
@testable import RichTextEditorUIKit
|
|
import RichTextEditorCore
|
|
|
|
/// The editor convention: a view never `setNeedsLayout()`s itself for a content-height change — it
|
|
/// NOTIFIES its parent (`onContentSizeChange`), which drives layout explicitly. `notifyContentSizeChanged()`
|
|
/// is that notifier.
|
|
final class LayoutNotificationTests: XCTestCase {
|
|
func test_notifyContentSizeChanged_firesCallback() {
|
|
let v = DocumentCanvasView()
|
|
v.setBlocks([.paragraph(ParagraphBlock(id: BlockID("p"), runs: [TextRun(text: "Hi")]))], width: 320)
|
|
var count = 0
|
|
v.onContentSizeChange = { count += 1 }
|
|
v.notifyContentSizeChanged()
|
|
XCTAssertEqual(count, 1, "notifyContentSizeChanged() fires the host content-size callback")
|
|
}
|
|
}
|
|
#endif
|