@@ -36,6 +36,145 @@ T["left integration"]["opening closes zen side buffer, closing reopens it"] = fu
3636 })
3737end
3838
39+
40+ T [" left integration" ][" opening an integration should close the existing integration on the same side" ] = function ()
41+ child .cmd (" Fyler kind=split_left_most" )
42+
43+ Helpers .expect .layout (child , {
44+ type = " row" ,
45+ children = {
46+ { type = " leaf" , filetype = " fyler" , buftype = " acwrite" , width = 46 , height = 50 },
47+ { type = " leaf" , filetype = " " , buftype = " " , width = 146 , height = 50 },
48+ { type = " leaf" , filetype = " zen-right" , buftype = " nofile" , width = 46 , height = 50 },
49+ },
50+ })
51+
52+ child .cmd (" DBUI" )
53+
54+ Helpers .expect .layout (child , {
55+ type = " row" ,
56+ children = {
57+ { type = " leaf" , filetype = " dbui" , buftype = " nofile" , width = 46 , height = 50 },
58+ { type = " leaf" , filetype = " " , buftype = " " , width = 146 , height = 50 },
59+ { type = " leaf" , filetype = " zen-right" , buftype = " nofile" , width = 46 , height = 50 },
60+ },
61+ })
62+ end
63+
64+ T [" top integration" ] = MiniTest .new_set ({})
65+
66+ T [" top integration" ][" opening" ] = function ()
67+ child .cmd (" Git" )
68+
69+ Helpers .expect .layout (child , {
70+ type = " col" ,
71+ children = {
72+ { type = " leaf" , filetype = " fugitive" , buftype = " nowrite" , width = 240 , height = 25 },
73+ {
74+ type = " row" ,
75+ children = {
76+ { type = " leaf" , filetype = " zen-left" , buftype = " nofile" , width = 46 , height = 24 },
77+ { type = " leaf" , filetype = " " , buftype = " " , width = 146 , height = 24 },
78+ { type = " leaf" , filetype = " zen-right" , buftype = " nofile" , width = 46 , height = 24 },
79+ },
80+ },
81+ },
82+ })
83+ end
84+
85+ T [" top integration" ][" opening an integration should close the existing integration on the same side" ] = function ()
86+ child .cmd (" Git" )
87+
88+ Helpers .expect .layout (child , {
89+ type = " col" ,
90+ children = {
91+ { type = " leaf" , filetype = " fugitive" , buftype = " nowrite" , width = 240 , height = 25 },
92+ {
93+ type = " row" ,
94+ children = {
95+ { type = " leaf" , filetype = " zen-left" , buftype = " nofile" , width = 46 , height = 24 },
96+ { type = " leaf" , filetype = " " , buftype = " " , width = 146 , height = 24 },
97+ { type = " leaf" , filetype = " zen-right" , buftype = " nofile" , width = 46 , height = 24 },
98+ },
99+ },
100+ },
101+ })
102+
103+ child .cmd (" Man ls" )
104+
105+ Helpers .expect .layout (child , {
106+ type = " col" ,
107+ children = {
108+ { type = " leaf" , filetype = " man" , buftype = " nofile" , width = 240 , height = 25 },
109+ {
110+ type = " row" ,
111+ children = {
112+ { type = " leaf" , filetype = " zen-left" , buftype = " nofile" , width = 46 , height = 24 },
113+ { type = " leaf" , filetype = " " , buftype = " " , width = 146 , height = 24 },
114+ { type = " leaf" , filetype = " zen-right" , buftype = " nofile" , width = 46 , height = 24 },
115+ },
116+ },
117+ },
118+ })
119+ end
120+
121+ T [" bottom integration" ] = MiniTest .new_set ({})
122+
123+ T [" bottom integration" ][" opening" ] = function ()
124+ child .cmd (" Trouble diagnostics" )
125+
126+ Helpers .expect .layout (child , {
127+ type = " col" ,
128+ children = {
129+ {
130+ type = " row" ,
131+ children = {
132+ { type = " leaf" , filetype = " zen-left" , buftype = " nofile" , width = 46 , height = 39 },
133+ { type = " leaf" , filetype = " " , buftype = " " , width = 146 , height = 39 },
134+ { type = " leaf" , filetype = " zen-right" , buftype = " nofile" , width = 46 , height = 39 },
135+ },
136+ },
137+ { type = " leaf" , filetype = " trouble" , buftype = " nofile" , width = 240 , height = 10 },
138+ },
139+ })
140+ end
141+
142+ T [" bottom integration" ][" opening an integration should close the existing integration on the same side" ] = function ()
143+ child .cmd (" Trouble diagnostics" )
144+
145+ Helpers .expect .layout (child , {
146+ type = " col" ,
147+ children = {
148+ {
149+ type = " row" ,
150+ children = {
151+ { type = " leaf" , filetype = " zen-left" , buftype = " nofile" , width = 46 , height = 39 },
152+ { type = " leaf" , filetype = " " , buftype = " " , width = 146 , height = 39 },
153+ { type = " leaf" , filetype = " zen-right" , buftype = " nofile" , width = 46 , height = 39 },
154+ },
155+ },
156+ { type = " leaf" , filetype = " trouble" , buftype = " nofile" , width = 240 , height = 10 },
157+ },
158+ })
159+
160+ child .cmd (" copen" )
161+
162+ Helpers .expect .layout (child , {
163+ type = " col" ,
164+ children = {
165+ {
166+ type = " row" ,
167+ children = {
168+ { type = " leaf" , filetype = " zen-left" , buftype = " nofile" , width = 46 , height = 39 },
169+ { type = " leaf" , filetype = " " , buftype = " " , width = 146 , height = 39 },
170+ { type = " leaf" , filetype = " zen-right" , buftype = " nofile" , width = 46 , height = 39 },
171+ },
172+ },
173+ { type = " leaf" , filetype = " qf" , buftype = " quickfix" , width = 240 , height = 10 },
174+ },
175+ })
176+ end
177+
39178T [" right integration" ] = MiniTest .new_set ({})
40179
41180T [" right integration" ][" opening closes zen side buffer, closing reopens it" ] = function ()
@@ -62,4 +201,60 @@ T["right integration"]["opening closes zen side buffer, closing reopens it"] = f
62201 })
63202end
64203
204+ T [" right integration" ][" opening an integration should close the existing integration on the same side" ] = function ()
205+ child .cmd (" Neotest summary open" )
206+
207+ Helpers .expect .layout (child , {
208+ type = " row" ,
209+ children = {
210+ { type = " leaf" , filetype = " zen-left" , buftype = " nofile" , width = 46 , height = 50 },
211+ { type = " leaf" , filetype = " " , buftype = " " , width = 142 , height = 50 },
212+ { type = " leaf" , filetype = " neotest-summary" , buftype = " nofile" , width = 50 , height = 50 },
213+ },
214+ })
215+
216+ child .lua ([[ vim.o.splitright = true; require("CopilotChat").open()]] )
217+
218+ Helpers .expect .layout (child , {
219+ type = " row" ,
220+ children = {
221+ { type = " leaf" , filetype = " zen-left" , buftype = " nofile" , width = 46 , height = 50 },
222+ { type = " leaf" , filetype = " " , buftype = " " , width = 146 , height = 50 },
223+ { type = " leaf" , filetype = " copilot-chat" , buftype = " nofile" , width = 46 , height = 50 },
224+ },
225+ })
226+ end
227+
228+ T [" right integration" ][" opening an integration with table filetype" ] = function ()
229+ child .lua ([[ require("dapui").open()]] )
230+
231+ Helpers .expect .layout (child , {
232+ type = " row" ,
233+ children = {
234+ {
235+ type = " col" ,
236+ children = {
237+ { type = " leaf" , filetype = " dapui_watches" , buftype = " prompt" , width = 40 , height = 12 },
238+ { type = " leaf" , filetype = " dapui_stacks" , buftype = " nofile" , width = 40 , height = 12 },
239+ { type = " leaf" , filetype = " dapui_breakpoints" , buftype = " nofile" , width = 40 , height = 12 },
240+ { type = " leaf" , filetype = " dapui_scopes" , buftype = " nofile" , width = 40 , height = 11 },
241+ },
242+ },
243+ {
244+ type = " col" ,
245+ children = {
246+ { type = " leaf" , filetype = " " , buftype = " " , width = 199 , height = 39 },
247+ {
248+ type = " row" ,
249+ children = {
250+ { type = " leaf" , filetype = " dapui_console" , buftype = " nofile" , width = 99 , height = 10 },
251+ { type = " leaf" , filetype = " dap-repl" , buftype = " prompt" , width = 99 , height = 10 },
252+ },
253+ },
254+ },
255+ },
256+ },
257+ })
258+ end
259+
65260return T
0 commit comments