Download this file
| 1 | #if os(macOS) |
| 2 | import XCTest |
| 3 | @testable import DocsKit |
| 4 | |
| 5 | /// The Format inspector's style pop-up (Fable on #169, finding 5): a |
| 6 | /// selection in Heading 4–6 shows that level, not the last style shown. |
| 7 | final class DocsInspectorStyleTests: XCTestCase { |
| 8 | @MainActor func testHeadingsFourToSixShowTheirOwnLevel() { |
| 9 | let en = DocsStrings(locale: Locale(identifier: "en")) |
| 10 | XCTAssertEqual(DocsFormatInspector.styleEntries(selected: "paragraph", strings: en).map(\.id), ["paragraph", "heading1", "heading2", "heading3"]) |
| 11 | let five = DocsFormatInspector.styleEntries(selected: "heading5", strings: en) |
| 12 | XCTAssertEqual(five.last?.id, "heading5", "the pop-up can select it") |
| 13 | XCTAssertEqual(five.last?.title, "Heading 5") |
| 14 | let ru = DocsFormatInspector.styleEntries(selected: "heading4", strings: DocsStrings(locale: Locale(identifier: "ru"))) |
| 15 | XCTAssertEqual(ru.last?.title, "Заголовок 4") |
| 16 | } |
| 17 | } |
| 18 | #endif |
| 19 | |