@@ -16,6 +16,7 @@ afterEach(() => {
1616 useAuthStore ( ) . me = undefined as any ;
1717 useApplicationSettingsStore ( ) . settings = [ ] ;
1818 useMatchmakingStore ( ) . joinedMatchmakingQueues = { } as any ;
19+ useMatchmakingStore ( ) . lobbies = [ ] as any ;
1920} ) ;
2021
2122describe ( "PlayMatchmaking" , ( ) => {
@@ -68,6 +69,38 @@ describe("PlayMatchmaking", () => {
6869 expect ( findMatch ?. attributes ( "disabled" ) ) . toBeDefined ( ) ;
6970 } ) ;
7071
72+ it ( "opens the seat row once a solo player picks a mode" , async ( ) => {
73+ useAuthStore ( ) . me = {
74+ steam_id : "76561198000000001" ,
75+ role : "user" ,
76+ } as any ;
77+
78+ const wrapper = await mountSuspended ( PlayMatchmaking ) ;
79+
80+ expect ( wrapper . text ( ) ) . not . toContain ( "Your side" ) ;
81+ await wrapper . findAll ( '[role="radio"]' ) [ 0 ] . trigger ( "click" ) ;
82+ expect ( wrapper . text ( ) ) . toContain ( "Your side" ) ;
83+ } ) ;
84+
85+ it ( "shows the seats right away in a lobby, even one of just you" , async ( ) => {
86+ const me = { steam_id : "76561198000000001" , role : "user" } ;
87+ useAuthStore ( ) . me = me as any ;
88+ useMatchmakingStore ( ) . lobbies = [
89+ {
90+ id : "lobby-1" ,
91+ access : "Invite" ,
92+ players : [ { status : "Accepted" , captain : true , player : me } ] ,
93+ } ,
94+ ] as any ;
95+
96+ const wrapper = await mountSuspended ( PlayMatchmaking ) ;
97+
98+ expect ( wrapper . find ( '[role="radio"][aria-checked="true"]' ) . exists ( ) ) . toBe (
99+ false ,
100+ ) ;
101+ expect ( wrapper . text ( ) ) . toContain ( "Your side" ) ;
102+ } ) ;
103+
71104 it ( "picks the mode when it's the only one" , async ( ) => {
72105 useAuthStore ( ) . me = {
73106 steam_id : "76561198000000001" ,
0 commit comments