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

27 lines
1.1 KiB
Swift

#if canImport(UIKit)
import XCTest
import UIKit
@testable import RichTextEditorUIKit
import RichTextEditorCore
final class AttributedStringMapperInlineCodeTests: XCTestCase {
// Inline-code background must come from the theme, not a hardcoded color.
func test_inlineCode_backgroundComesFromTheme() {
let theme = RichTextEditorTheme(
primaryText: .black, secondaryText: .black, placeholder: .placeholderText,
accent: .link, tableBorder: .gray, tableHeaderBackground: .gray, codeBackground: .gray,
inlineCodeBackground: .magenta
)
let mapper = AttributedStringMapper(theme: theme)
let dict = mapper.attributes(for: CharacterAttributes(inlineCode: true), style: .body)
XCTAssertEqual(dict[.backgroundColor] as? UIColor, .magenta)
}
// Default mapper still reproduces the prior `.systemGray5` pill.
func test_inlineCode_defaultBackgroundIsSystemGray5() {
let dict = AttributedStringMapper().attributes(for: CharacterAttributes(inlineCode: true), style: .body)
XCTAssertEqual(dict[.backgroundColor] as? UIColor, .systemGray5)
}
}
#endif