Skip to content

Commit 911e68c

Browse files
committed
refactor tests
1 parent 104917e commit 911e68c

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

test/test-grouped-connections.vim

+9-11
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ function s:suite.after() abort
88
call Cleanup()
99
endfunction
1010

11-
function! s:suite.should_prompt_to_enter_url_for_new_connection() abort
12-
let g:test_connection_name = '/group/connection-file-db'
11+
function! s:suite.should_create_groups_and_connections() abort
12+
let g:test_connection_name = '/group/connection-first-db'
1313
runtime autoload/db_ui/utils.vim
1414
function! db_ui#utils#input(name, val)
1515
if a:name ==? 'Enter connection url: '
@@ -21,19 +21,17 @@ function! s:suite.should_prompt_to_enter_url_for_new_connection() abort
2121
endif
2222
endfunction
2323

24-
call s:expect(&filetype).not.to_equal('dbui')
25-
:DBUIAddConnection
2624
:DBUI
27-
call s:expect(&filetype).to_equal('dbui')
25+
norm A
2826
call s:expect(getline(1, '$')).to_equal(['▸ group'])
2927
norm o
30-
call s:expect(getline(1, '$')).to_equal(['▾ group', ' ▸ connection-file-db'])
28+
call s:expect(getline(1, '$')).to_equal(['▾ group', ' ▸ connection-first-db'])
3129
let g:test_connection_name = '/group/nested-group/connection-second-db'
3230
norm A
33-
call s:expect(getline(1, '$')).to_equal(['▾ group', ' ▸ connection-file-db', ' ▸ nested-group'])
31+
call s:expect(getline(1, '$')).to_equal(['▾ group', ' ▸ connection-first-db', ' ▸ nested-group'])
3432
endfunction
3533

36-
function! s:suite.should_allow_renaming_connection() abort
34+
function! s:suite.should_allow_renaming_groups_and_connections() abort
3735
let g:test_group_name = 'edited-group-name'
3836
function! db_ui#utils#input(name, val)
3937
if a:name ==? 'Edit group name: '
@@ -51,13 +49,13 @@ function! s:suite.should_allow_renaming_connection() abort
5149
:DBUI
5250
norm r
5351
call s:expect(getline(1, '$')).to_equal(['▸ edited-group-name'])
52+
norm ojr
5453
let g:test_group_name = 'edited-nested-group-name'
55-
norm ojrA
56-
norm jrA
54+
norm jr
5755
call s:expect(getline(1, '$')).to_equal(['▾ edited-group-name', ' ▸ edited-db-name', ' ▸ edited-nested-group-name'])
5856
endfunction
5957

60-
function! s:suite.should_delete_connection() abort
58+
function! s:suite.should_delete_group_and_connection() abort
6159
norm d
6260
call s:expect(getline(1, '$')).to_equal(['▾ edited-group-name', ' ▸ edited-db-name'])
6361
norm d

0 commit comments

Comments
 (0)