@@ -111,3 +111,103 @@ test.describe('Client Management', () => {
111111 }
112112 } ) ;
113113} ) ;
114+
115+ test . describe ( 'Client Toast Notifications' , ( ) => {
116+ test ( 'should have toast container on clients page' , async ( { page } ) => {
117+ const dashboard = new DashboardPage ( page ) ;
118+ const clients = new ClientsPage ( page ) ;
119+ await dashboard . navigate ( ) ;
120+
121+ await page . locator ( 'nav button:has-text("Clients")' ) . click ( ) ;
122+ await expect ( clients . heading ) . toBeVisible ( ) ;
123+
124+ await expect ( clients . toastContainer ) . toBeAttached ( ) ;
125+ } ) ;
126+
127+ // Skip in web mode - requires Tauri API for client operations
128+ test . skip ( 'should show success toast when saving client config' , async ( { page } ) => {
129+ const dashboard = new DashboardPage ( page ) ;
130+ const clients = new ClientsPage ( page ) ;
131+ await dashboard . navigate ( ) ;
132+
133+ await page . locator ( 'nav button:has-text("Clients")' ) . click ( ) ;
134+
135+ // Click first client card to open panel
136+ const clientCards = page . locator ( '[data-testid^="client-card-"]' ) ;
137+ const count = await clientCards . count ( ) ;
138+
139+ if ( count > 0 ) {
140+ await clientCards . first ( ) . click ( ) ;
141+
142+ // Wait for panel to open
143+ await expect ( page . locator ( 'text=Quick Settings' ) ) . toBeVisible ( ) ;
144+
145+ // Click Save Changes
146+ const saveButton = page . getByRole ( 'button' , { name : / S a v e C h a n g e s / i } ) ;
147+ if ( await saveButton . isVisible ( ) ) {
148+ await saveButton . click ( ) ;
149+
150+ await clients . waitForToast ( 'success' ) ;
151+ const toastText = await clients . getToastText ( ) ;
152+ expect ( toastText ) . toContain ( 'Client settings saved' ) ;
153+ }
154+ }
155+ } ) ;
156+
157+ // Skip in web mode - requires Tauri API for client deletion
158+ test . skip ( 'should show success toast when removing a client' , async ( { page } ) => {
159+ const dashboard = new DashboardPage ( page ) ;
160+ const clients = new ClientsPage ( page ) ;
161+ await dashboard . navigate ( ) ;
162+
163+ await page . locator ( 'nav button:has-text("Clients")' ) . click ( ) ;
164+
165+ const clientCards = page . locator ( '[data-testid^="client-card-"]' ) ;
166+ const count = await clientCards . count ( ) ;
167+
168+ if ( count > 0 ) {
169+ await clientCards . first ( ) . click ( ) ;
170+
171+ // Click Remove Client in panel footer
172+ page . on ( 'dialog' , dialog => dialog . accept ( ) ) ;
173+ const removeButton = page . getByRole ( 'button' , { name : / R e m o v e C l i e n t / i } ) ;
174+ if ( await removeButton . isVisible ( ) ) {
175+ await removeButton . click ( ) ;
176+
177+ await clients . waitForToast ( 'success' ) ;
178+ const toastText = await clients . getToastText ( ) ;
179+ expect ( toastText ) . toContain ( 'Client removed' ) ;
180+ }
181+ }
182+ } ) ;
183+
184+ // Skip in web mode - requires Tauri API for permission toggle
185+ test . skip ( 'should show success toast when toggling feature set grant' , async ( { page } ) => {
186+ const dashboard = new DashboardPage ( page ) ;
187+ const clients = new ClientsPage ( page ) ;
188+ await dashboard . navigate ( ) ;
189+
190+ await page . locator ( 'nav button:has-text("Clients")' ) . click ( ) ;
191+
192+ const clientCards = page . locator ( '[data-testid^="client-card-"]' ) ;
193+ const count = await clientCards . count ( ) ;
194+
195+ if ( count > 0 ) {
196+ await clientCards . first ( ) . click ( ) ;
197+
198+ // Expand Permissions section
199+ await page . locator ( 'text=Permissions' ) . click ( ) ;
200+ await page . waitForTimeout ( 300 ) ;
201+
202+ // Find a non-default feature set checkbox
203+ const featureSetToggle = page . locator ( 'button:has([class*="rounded border"])' ) . first ( ) ;
204+ if ( await featureSetToggle . isVisible ( ) ) {
205+ await featureSetToggle . click ( ) ;
206+
207+ await clients . waitForToast ( 'success' ) ;
208+ const toastText = await clients . getToastText ( ) ;
209+ expect ( toastText ) . toMatch ( / P e r m i s s i o n ( g r a n t e d | r e v o k e d ) / ) ;
210+ }
211+ }
212+ } ) ;
213+ } ) ;
0 commit comments