@@ -4358,6 +4358,77 @@ public void SelectingNonTopLevelItemInOverflow()
4358
4358
}
4359
4359
}
4360
4360
4361
+ [ TestMethod ]
4362
+ [ TestProperty ( "TestSuite" , "D" ) ]
4363
+ public void VerifyCorrectVisualStateWhenClosingPaneInLeftDisplayMode ( )
4364
+ {
4365
+ using ( var setup = new TestSetupHelper ( new [ ] { "NavigationView Tests" , "NavigationView Test" } ) )
4366
+ {
4367
+ // Test for explicit pane close
4368
+
4369
+ // make sure the NavigationView is in left mode with pane expanded
4370
+ Log . Comment ( "Change display mode to left expanded" ) ;
4371
+ var panelDisplayModeComboBox = new ComboBox ( FindElement . ByName ( "PaneDisplayModeCombobox" ) ) ;
4372
+ panelDisplayModeComboBox . SelectItemByName ( "Left" ) ;
4373
+ Wait . ForIdle ( ) ;
4374
+
4375
+ TextBlock displayModeTextBox = new TextBlock ( FindElement . ByName ( "DisplayModeTextBox" ) ) ;
4376
+ Verify . AreEqual ( expanded , displayModeTextBox . DocumentText ) ;
4377
+
4378
+ Button togglePaneButton = new Button ( FindElement . ById ( "TogglePaneButton" ) ) ;
4379
+
4380
+ // manually close pane
4381
+ Log . Comment ( "Close NavView pane explicitly" ) ;
4382
+ togglePaneButton . Invoke ( ) ;
4383
+ Wait . ForIdle ( ) ;
4384
+
4385
+ WaitAndAssertPaneStatus ( PaneOpenStatus . Closed ) ;
4386
+
4387
+ Log . Comment ( "Get NavView Active VisualStates" ) ;
4388
+ var getNavViewActiveVisualStatesButton = new Button ( FindElement . ByName ( "GetNavViewActiveVisualStates" ) ) ;
4389
+ getNavViewActiveVisualStatesButton . Invoke ( ) ;
4390
+ Wait . ForIdle ( ) ;
4391
+
4392
+ // check visual state
4393
+ var visualStateName = "ListSizeCompact" ;
4394
+ var result = new TextBlock ( FindElement . ByName ( "NavViewActiveVisualStatesResult" ) ) ;
4395
+
4396
+ Verify . IsTrue ( result . GetText ( ) . Contains ( visualStateName ) , "active VisualStates doesn't include " + visualStateName ) ;
4397
+
4398
+ // Test for light dismiss pane close
4399
+
4400
+ Log . Comment ( "Change display mode to left compact" ) ;
4401
+ panelDisplayModeComboBox = new ComboBox ( FindElement . ByName ( "PaneDisplayModeCombobox" ) ) ;
4402
+ panelDisplayModeComboBox . SelectItemByName ( "LeftCompact" ) ;
4403
+ Wait . ForIdle ( ) ;
4404
+
4405
+ displayModeTextBox = new TextBlock ( FindElement . ByName ( "DisplayModeTextBox" ) ) ;
4406
+ Verify . AreEqual ( compact , displayModeTextBox . DocumentText ) ;
4407
+
4408
+ // expand pane
4409
+ Log . Comment ( "Expand NavView pane" ) ;
4410
+ togglePaneButton . Invoke ( ) ;
4411
+ Wait . ForIdle ( ) ;
4412
+
4413
+ WaitAndAssertPaneStatus ( PaneOpenStatus . Opened ) ;
4414
+
4415
+ // light dismiss pane
4416
+ Log . Comment ( "Light dismiss NavView pane" ) ;
4417
+ getNavViewActiveVisualStatesButton . Click ( ) ; // NOTE: Must be Click because this is verifying that the mouse light dismiss behavior closes the nav view
4418
+ Wait . ForIdle ( ) ;
4419
+
4420
+ WaitAndAssertPaneStatus ( PaneOpenStatus . Closed ) ;
4421
+
4422
+ Log . Comment ( "Get NavView Active VisualStates" ) ;
4423
+ getNavViewActiveVisualStatesButton . Invoke ( ) ;
4424
+ Wait . ForIdle ( ) ;
4425
+
4426
+ // check visual state
4427
+ result = new TextBlock ( FindElement . ByName ( "NavViewActiveVisualStatesResult" ) ) ;
4428
+ Verify . IsTrue ( result . GetText ( ) . Contains ( visualStateName ) , "active VisualStates doesn't include " + visualStateName ) ;
4429
+ }
4430
+ }
4431
+
4361
4432
private void EnsurePaneHeaderCanBeModifiedHelper ( RegressionTestType navviewMode )
4362
4433
{
4363
4434
if ( ! PlatformConfiguration . IsOsVersionGreaterThanOrEqual ( OSVersion . Redstone2 ) )
0 commit comments