{"size": 1060, "ext": "js", "max_stars_repo_path": "src/js/core/sources/setUpSourceDisplayFacade.test.js", "max_stars_repo_name": "edwardjosephbennett/fslightbox", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/js/core/sources/setUpSourceDisplayFacade.test.js", "max_issues_repo_name": "edwardjosephbennett/fslightbox", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/js/core/sources/setUpSourceDisplayFacade.test.js", "max_forks_repo_name": "edwardjosephbennett/fslightbox", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 32.1212121212, "max_line_length": 78, "alphanum_fraction": 0.6905660377}
import { setUpSourceDisplayFacade } from "./setUpSourceDisplayFacade";

const fsLightbox = {
    collections: {
        sourcesRenderFunctions: [
            null,
            () => wasFirstSourceRenderCalled = true,
            null,
            () => wasThirdSourceRenderCalled = true,
            jest.fn()
        ]
    },
    core: { sourceDisplayFacade: {} },
    stageIndexes: {
        previous: 1,
        current: 2,
        next: 3
    }
};
let wasFirstSourceRenderCalled;
let wasThirdSourceRenderCalled;
const sourceDisplayFacade = fsLightbox.core.sourceDisplayFacade;
setUpSourceDisplayFacade(fsLightbox);

test('displayStageSourcesIfNotYet', () => {
    sourceDisplayFacade.displayStageSourcesIfNotYet();
    expect(wasFirstSourceRenderCalled).toBe(true);
    expect(wasThirdSourceRenderCalled).toBe(true);
    expect(fsLightbox.collections.sourcesRenderFunctions[1]).toBeUndefined();
    expect(fsLightbox.collections.sourcesRenderFunctions[3]).toBeUndefined();
    expect(fsLightbox.collections.sourcesRenderFunctions[4]).not.toBeCalled();
});
