@Test
public void should_delete_a_custom_widget() throws Exception {

    Widget customLabel = aWidget().id("customLabel").build();
    customLabel.setController("$scope.hello = 'Hello'");
    customLabel.setTemplate("<div>{{ hello + 'there'}}</div>");
    customLabel.setCustom(true);
    createDirectories(widgetDirectory.resolve("customLabel"));
    widgetRepository.updateLastUpdateAndSave(customLabel);
    // emulate js generation
    write(widgetDirectory.resolve("customLabel").resolve("customLabel.js"), objectMapper.toJson(""));
    widgetRepository.delete("customLabel");
    assertThat(jsonFile(customLabel)).doesNotExist();
    assertThat(jsFile(customLabel)).doesNotExist();
}