extract functions and add unit tests for them. Mock drawio api functions in unit tests
extract functions and add unit tests for them. Mock drawio api functions in unit tests