Test was still failing because it checked the document content before closing. This commit forces document flush before this check, making the test successful.
Test was still failing because it checked the document content before closing. This commit forces document flush before this check, making the test successful.