add appendLinks & removeLinks in tests.js (refactoring)