@Test
public void shouldImport_sameJsScript_andSameSpec_onlyOnes_withinDifferentLevels_ofSpecs() throws IOException {
JsTestRegistry.get().clear();
PageSpec pageSpec = readSpec("/specs/same-import/main.spec");
assertThat("Amount of events should be", JsTestRegistry.get().getEvents().size(), is(1));
assertThat("Events should be", JsTestRegistry.get().getEvents(), contains("script is loaded"));
assertThat("Amout of sections should be", pageSpec.getSections().size(), is(3));
assertThat(pageSpec.getSections().get(0).getObjects().get(0).getObjectName(), is("main-item"));
assertThat(pageSpec.getSections().get(0).getObjects().get(0).getSpecs().get(0).getOriginalText(), is("text is: name from script"));
assertThat(pageSpec.getSections().get(1).getObjects().get(0).getObjectName(), is("common-object"));
assertThat(pageSpec.getSections().get(1).getObjects().get(0).getSpecs().get(0).getOriginalText(), is("width: 100px"));
assertThat(pageSpec.getSections().get(2).getObjects().get(0).getObjectName(), is("sub-item"));
assertThat(pageSpec.getSections().get(2).getObjects().get(0).getSpecs().get(0).getOriginalText(), is("text is: name from script"));
}