Skip to content

Commit cda2876

Browse files
committed
updated test for ZooHierarchyApp to use Eventually in checking for title bar update. This fixes a sporadic test failure in R2021a
1 parent 7fa9e74 commit cda2876

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

test/+wt/+test/ZooHierarchyApp.m

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,21 @@ function testSaveLoadSession(testCase)
300300

301301
% Find the animal view
302302
view = cview.ActiveView;
303+
304+
import matlab.unittest.constraints.Eventually
305+
import matlab.unittest.constraints.Matches
303306

304307
% Verify name in view matches
305308
diag = "Expected updated name to display in the view after loading.";
306-
actVal = view.NameField.Value;
307-
testCase.verifyMatches(actVal, newName, diag);
309+
testCase.verifyThat(...
310+
@()string(view.NameField.Value),...
311+
Eventually(Matches(newName), "WithTimeoutOf", 5), ...
312+
diag);
313+
314+
% Verify name in view matches
315+
% diag = "Expected updated name to display in the view after loading.";
316+
% actVal = view.NameField.Value;
317+
% testCase.verifyMatches(actVal, newName, diag);
308318

309319
end %function
310320

0 commit comments

Comments
 (0)