Skip to content

Commit

Permalink
add new test to ribbonbar #769
Browse files Browse the repository at this point in the history
  • Loading branch information
Shivan Oskan committed Jul 27, 2021
1 parent 62fdb67 commit a1570a7
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { setPanelSelection } from "../../state/store/appSettings/panelSelection/
import { RibbonBarController } from "./ribbonBar.component"
import { PanelSelectionService } from "../../state/store/appSettings/panelSelection/panelSelection.service"
import { ExperimentalFeaturesEnabledService } from "../../state/store/appSettings/enableExperimentalFeatures/experimentalFeaturesEnabled.service"
import { addFile, resetFiles, setDelta } from "../../state/store/files/files.actions"
import { TEST_DELTA_MAP_A, TEST_DELTA_MAP_B } from "../../util/dataMocks"

describe("RibbonBarController", () => {
let ribbonBarController: RibbonBarController
Expand Down Expand Up @@ -95,4 +97,17 @@ describe("RibbonBarController", () => {
expect(appSettings.panelSelection).toEqual(PanelSelection.COLOR_PANEL_OPEN)
})
})

describe("onFilesSelectionChanged", () => {
it("should detect delta mode selection", () => {
storeService.dispatch(resetFiles())
storeService.dispatch(addFile(TEST_DELTA_MAP_A))
storeService.dispatch(addFile(TEST_DELTA_MAP_B))
storeService.dispatch(setDelta(TEST_DELTA_MAP_A, TEST_DELTA_MAP_B))
ribbonBarController.onFilesSelectionChanged(storeService.getState().files)

expect(ribbonBarController["_viewModel"].files).toEqual(storeService.getState().files)
expect(ribbonBarController["_viewModel"].isDeltaState).toEqual(true)
})
})
})

0 comments on commit a1570a7

Please sign in to comment.