adding test to ensure that onclose is called after file is rendered