Skip to content

Commit 5276f99

Browse files
committed
test(margin): add margin popup spec
Also had to change the help popup slightly: because columns are calculated dynamically, adding an entry for the margin popup changed the order of some of the existing entries.
1 parent 073995d commit 5276f99

File tree

2 files changed

+33
-7
lines changed

2 files changed

+33
-7
lines changed

spec/popups/help_popup_spec.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
" Commands Applying changes Essential commands ",
1111
" $ History M Remote <c-s> Stage all <c-r> Refresh ",
1212
" A Cherry Pick m Merge K Untrack <cr> Go to file ",
13-
" b Branch P Push s Stage <tab> Toggle ",
14-
" B Bisect p Pull S Stage unstaged ",
13+
" b Branch p Pull s Stage <tab> Toggle ",
14+
" B Bisect P Push S Stage unstaged ",
1515
" c Commit Q Command u Unstage ",
1616
" d Diff r Rebase U Unstage all ",
1717
" f Fetch t Tag x Discard ",
18-
" I Init v Revert ",
19-
" i Ignore w Worktree ",
20-
" l Log X Reset ",
21-
" Z Stash "
18+
" i Ignore v Revert ",
19+
" I Init w Worktree ",
20+
" L Margin X Reset ",
21+
" l Log Z Stash "
2222
]
2323
end
2424

25-
%w[$ A b B c d f i I l M m P p r t v w X Z].each { include_examples "interaction", _1 }
25+
%w[$ A b B c d f i I l L M m P p r t v w X Z].each { include_examples "interaction", _1 }
2626
end

spec/popups/margin_popup_spec.rb

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# frozen_string_literal: true
2+
3+
require "spec_helper"
4+
5+
RSpec.describe "Margin Popup", :git, :nvim, :popup do # rubocop:disable RSpec/EmptyExampleGroup
6+
before { nvim.keys("L") }
7+
8+
let(:view) do
9+
[
10+
" Arguments ",
11+
" -n Limit number of commits (--max-count=256) ",
12+
" -o Order commits by (--[topo|author-date|date]-order) ",
13+
" -g Show graph (--graph) ",
14+
" -c Show graph in color (--color) ",
15+
" -d Show refnames (--decorate) ",
16+
" ",
17+
" Refresh Margin ",
18+
" g buffer L toggle visibility ",
19+
" l cycle style ",
20+
" d toggle details ",
21+
" x toggle shortstat "
22+
]
23+
end
24+
25+
%w[L l d].each { include_examples "interaction", _1 }
26+
end

0 commit comments

Comments
 (0)