mirror of
https://github.com/ichmagmaus111/ghostgram.git
synced 2026-11-09 16:57:55 +01:00
Ghostgram for iOS, rebuilt from scratch on Telegram iOS 13.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
35 lines
1.1 KiB
Swift
35 lines
1.1 KiB
Swift
#if canImport(UIKit)
|
|
import XCTest
|
|
import UIKit
|
|
@testable import RichTextEditorUIKit
|
|
import RichTextEditorCore
|
|
|
|
final class FacadeWritingDirectionTests: XCTestCase {
|
|
private func view() -> RichTextEditorView {
|
|
let v = RichTextEditorView(frame: CGRect(x: 0, y: 0, width: 320, height: 200))
|
|
v.document = Document(blocks: [.paragraph(ParagraphBlock(id: BlockID("a"),
|
|
runs: [TextRun(text: "Hi")]))])
|
|
return v
|
|
}
|
|
|
|
func test_overrideProperty_isReflectedInDocument() {
|
|
let v = view()
|
|
v.layoutDirectionOverride = .rightToLeft
|
|
XCTAssertEqual(v.layoutDirectionOverride, .rightToLeft)
|
|
XCTAssertEqual(v.document.layoutDirection, .rightToLeft)
|
|
}
|
|
|
|
func test_settingDocument_appliesItsLayoutDirection() {
|
|
let v = view()
|
|
var doc = v.document
|
|
doc.layoutDirection = .leftToRight
|
|
v.document = doc
|
|
XCTAssertEqual(v.layoutDirectionOverride, .leftToRight)
|
|
}
|
|
|
|
func test_default_isAuto() {
|
|
XCTAssertEqual(view().layoutDirectionOverride, .auto)
|
|
}
|
|
}
|
|
#endif
|