adds nice git interface
This commit is contained in:
@@ -7,26 +7,24 @@ import Testing
|
||||
@Test func addingActionsAreTeal() {
|
||||
#expect(ContextMenuOverlay.tint(for: .newFile(inDirectory: "")) == .add)
|
||||
#expect(ContextMenuOverlay.tint(for: .newFolder(inDirectory: "src")) == .add)
|
||||
#expect(ContextMenuOverlay.tint(for: .stage("a.php")) == .add)
|
||||
}
|
||||
|
||||
@Test func finderUnstageAndCopyFileNameAreAmberSoft() {
|
||||
@Test func finderAndCopyFileNameAreAmberSoft() {
|
||||
#expect(ContextMenuOverlay.tint(for: .revealInFinder("a.php")) == .modify)
|
||||
#expect(ContextMenuOverlay.tint(for: .unstage("a.php")) == .modify)
|
||||
#expect(ContextMenuOverlay.tint(for: .copyFileName("a.php")) == .modify)
|
||||
}
|
||||
|
||||
@Test func passOnOpenDiffAndRenameAreGrey() {
|
||||
@Test func passOnShowDiffAndRenameAreGrey() {
|
||||
#expect(ContextMenuOverlay.tint(for: .passOnReference("a.php", code: nil)) == .rename)
|
||||
#expect(ContextMenuOverlay.tint(for: .passOnFileName("a.php")) == .rename)
|
||||
#expect(ContextMenuOverlay.tint(for: .bouwen("x")) == .rename)
|
||||
#expect(ContextMenuOverlay.tint(for: .openDiff("a.php")) == .rename)
|
||||
#expect(ContextMenuOverlay.tint(for: .showDiff("a.php", line: 3)) == .rename)
|
||||
#expect(ContextMenuOverlay.tint(for: .rename("a.php", isDirectory: false)) == .rename)
|
||||
}
|
||||
|
||||
@Test func showDiffWearsTheOpenDiffIcon() {
|
||||
#expect(ContextMenuOverlay.symbol(for: .showDiff("a.php", line: 3)) == ContextMenuOverlay.symbol(for: .openDiff("a.php")))
|
||||
@Test func theGitViewItemsKeepThePlainIcon() {
|
||||
#expect(ContextMenuOverlay.tint(for: .openFile("a.php")) == .plain)
|
||||
#expect(ContextMenuOverlay.tint(for: .commit(andPush: true)) == .plain)
|
||||
}
|
||||
|
||||
@Test func copyReferenceKeepsThePlainIconThatTurnsAmberOnHighlight() {
|
||||
@@ -35,7 +33,7 @@ import Testing
|
||||
}
|
||||
|
||||
@Test func destructiveActionsAreAmberDeep() {
|
||||
#expect(ContextMenuOverlay.tint(for: .discard("a.php")) == .danger)
|
||||
#expect(ContextMenuOverlay.tint(for: .gitDiscard(["a.php"])) == .danger)
|
||||
#expect(ContextMenuOverlay.tint(for: .delete("a", isDirectory: true)) == .danger)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import Testing
|
||||
let listed = Set(ShortcutCatalog.groups.flatMap(\.rows).map { $0.keys.joined() })
|
||||
let handled = ["⌘F", "⌘↑↓", "↵", "⌘←→", "↑↓", "⇧⌘O", "⌘O", "⌘→", "⌘P",
|
||||
"⌘C", "⌘↵", "⌘G", "⌘M", "⌘S", "⌘.", "⌘A", "⌘L", "Esc",
|
||||
"⌘W", "⌘R", "⇧⌘N", "?", "⌘click", "⌘0", "⌘+", "⌘−"]
|
||||
"⌘W", "⌘R", "⇧⌘N", "?", "⌘click", "⌘0", "⌘+", "⌘−", "⌘1", "⌘2", "⌘3"]
|
||||
#expect(Set(handled).subtracting(listed).isEmpty)
|
||||
}
|
||||
|
||||
|
||||
@@ -218,15 +218,17 @@ private func makeModel(results: [String: [ContentGroup]] = [:], delays: [String:
|
||||
#expect(model.emptyMessage(for: .files) == "No file names match.")
|
||||
}
|
||||
|
||||
@Test func theFocusedColumnTakesSeventyPercentAndTheSidesKeepTheirMinimum() {
|
||||
let three: [SearchModel.Column] = [.thisFile, .project, .files]
|
||||
let resting = SearchModel.widths(total: 1000, columns: three, focused: .project)
|
||||
#expect(resting[.thisFile] == 230)
|
||||
#expect(resting[.files] == 250)
|
||||
#expect(resting[.project] == 520)
|
||||
let files = SearchModel.widths(total: 1000, columns: three, focused: .files)
|
||||
#expect(files[.files] == 700)
|
||||
#expect(files[.thisFile] == 180)
|
||||
#expect(files[.project] == 120)
|
||||
@Test func withThisFileTheColumnsTakeThirtyFortyFiveAndTwentyFivePercent() {
|
||||
let widths = SearchModel.widths(total: 1000, columns: [.thisFile, .project, .files])
|
||||
#expect(widths[.thisFile] == 300)
|
||||
#expect(widths[.project] == 450)
|
||||
#expect(widths[.files] == 250)
|
||||
}
|
||||
|
||||
@Test func withoutThisFileTheColumnsTakeSixtyFiveAndThirtyFivePercent() {
|
||||
let widths = SearchModel.widths(total: 1000, columns: [.project, .files])
|
||||
#expect(widths[.thisFile] == nil)
|
||||
#expect(widths[.project] == 650)
|
||||
#expect(widths[.files] == 350)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user