Files
ichmagmaus111andClaude Opus 5.5 0622057a4f Ghostgram: open-source release
Ghostgram for iOS, rebuilt from scratch on Telegram iOS 13.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 17:57:09 +01:00

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