]> git.sur5r.net Git - i3/i3/blob - testcases/t/146-floating-reinsert.t
Merge pull request #3435 from vivien/i3-msg/subscribe
[i3/i3] / testcases / t / 146-floating-reinsert.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # Please read the following documents before working on tests:
5 # • https://build.i3wm.org/docs/testsuite.html
6 #   (or docs/testsuite)
7 #
8 # • https://build.i3wm.org/docs/lib-i3test.html
9 #   (alternatively: perldoc ./testcases/lib/i3test.pm)
10 #
11 # • https://build.i3wm.org/docs/ipc.html
12 #   (or docs/ipc)
13 #
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 #   (unless you are already familiar with Perl)
16 #
17 use i3test;
18
19 my $tmp = fresh_workspace;
20
21 my $left = open_window;
22 my $mid = open_window;
23
24 cmd 'split v';
25 my $bottom = open_window;
26
27 my ($nodes, $focus) = get_ws_content($tmp);
28
29 #############################################################################
30 # 1: open a floating window, get it mapped
31 #############################################################################
32
33 # Create a floating window
34 my $window = open_floating_window;
35 ok($window->mapped, 'Window is mapped');
36
37 ($nodes, $focus) = get_ws_content($tmp);
38 is(@{$nodes->[1]->{nodes}}, 2, 'two windows in split con');
39
40 #############################################################################
41 # 2: make it tiling, see where it ends up
42 #############################################################################
43
44 cmd 'floating toggle';
45
46 ($nodes, $focus) = get_ws_content($tmp);
47
48 is(@{$nodes->[1]->{nodes}}, 3, 'three windows in split con after floating toggle');
49
50 done_testing;