@Test
public void should_build_directives_from_the_preview() throws IOException {

    Page page = aPage().build();
    when( pathResolver.getTmpPagesRepositoryPath()).thenReturn(temporaryFolder.toPath());
    Path assets = temporaryFolder.toPath().resolve(page.getId()).resolve("js");
    when(directiveFileGenerator.generateAllDirectivesFilesInOne(page, assets)).thenReturn("widgets-123456.min.js");
    List<String> imports = collector.buildUniqueDirectivesFiles(page, page.getId());
    Assertions.assertThat(imports).containsOnly("js/widgets-123456.min.js");
}