
    ^h                     @    S r SSKrSSKJr  S rS rS rS rS	 rS
 r	g)z&Test the notification area and widgets    N   )EDITOR_PAGEc                 2    U R                  SU S3[        S9$ )Nz5() => { return IPython.notification_area.get_widget('') !== undefined }pageevaluater   notebooknames     g/home/james-whalen/.local/lib/python3.13/site-packages/nbclassic/tests/end_to_end/test_notifications.py
get_widgetr      s*    
@FYZ       c                 2    U R                  SU S3[        S9$ )Nz1() => { return IPython.notification_area.widget('r   r   r	   r   s     r   widgetr      s*    
<TFBUV   r   c                 2    U R                  SU S3[        S9$ )NzB() => { return IPython.notification_area.new_notification_widget('r   r   r	   r   s     r   new_notification_widgetr      s*    
MdVSfg   r   c                 8    U R                  SU SU S3[        S9$ )N>() => {
        var w = IPython.notification_area.get_widget('z'');
        return w.element.hasClass('z'); }
        r   r	   )r   r   
class_names      r   widget_has_classr      s=    77;f =$$.< 0		    r   c                 2    U R                  SU S3[        S9$ )Nr   z.');
        return w.get_message(); }
        r   r	   r   s     r   widget_messager   '   s3    77;f =		    r   c                   ^  [        T S5      (       a  [        T S5      (       d   S5       e[        T S5      (       a  [        T S5      (       d   S5       e[        R                  " [        5         [        T S5        S S S 5        [        T S5      (       d   S5       e[        R                  " [        5         [        T S5        S S S 5        S Hk  nT R                  S	U S
U S3[        S9  T R                  S[        S9  [        T SU5      (       d
   U S35       e[        T S5      SU 3:X  a  Mc   U S35       e   T R                  S[        S9  T R                  S[        S9  [        T S5      S:X  d   S5       eT R                  S[        SS9  [        T S5      S:X  d   S5       eT R                  S[        S9  T R                  S[        S9  [        T S5      S:X  d   S5       eT R                  S[        S9R                  5         T R                  U 4S j5        T R                  S[        SS9  [        T S5      S:X  d   S5       eg ! , (       d  f       GN= f! , (       d  f       GN= f)Nkernelz%The kernel notification widget existsr   z'The notebook notification widget existsfoobarzwidget: new widget is created)infowarningdangerzQ
            var tnw = IPython.notification_area.widget('test');
            tnw.z('test z');
            r   z#notification_testtestz: class is incorrectztest z: message is incorrectzt
        var tnw = IPython.notification_area.widget('test');
        tnw.set_message('test timeout', 1000);
        ztest timeoutztimeout: message is incorrecthidden)state z timeout: message was not clearedz
        var tnw = IPython.notification_area.widget('test');
        tnw._clicked = false;
        tnw.set_message('test click', undefined, function () {
            tnw._clicked = true;
            return true;
        });
        z
test clickzcallback: message is correctc                  ,   > T R                  S[        S9$ )NzC() => { return IPython.notification_area.widget("test")._clicked; }r   r	   )notebook_frontends   r   <lambda>#test_notification.<locals>.<lambda>p   s    !**QXc + 
r   z!callback: message was not cleared)r   r   pytestraises	Exceptionr   r
   r   wait_for_selectorr   r   locateclickwait_for_condition)r'   levels   ` r   test_notificationr2   1   s   '22v>OQY7Z7Z 0/0Z'44@QS]9^9^ 212^ 
y	!$e, 
" #U++L-LL+ 
y	! 18< 
" /""wug &  	# 	
 	++,@{+S 165AAaeWL`CaaA/8eE7OKmPUwVlMmmK / 	    ''(<;'O+V4FgHggF''(<kQY'Z+V4:^<^^: 	   
 1D+V4DdFddD1DJJL((	
 ''(<kQY'Z+V4:_<__:{ 
"	! 
"	!s   .I	5I	
I
I*)
__doc__r*   utilsr   r   r   r   r   r   r2    r   r   <module>r6      s0    ,  E`r   