This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 758
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3456 from jasonLaster/7-25
New Release
- Loading branch information
Showing
20 changed files
with
3,973 additions
and
646 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React from "react"; | ||
import { shallow } from "enzyme"; | ||
import Breakpoints from "../Breakpoints"; | ||
import * as I from "immutable"; | ||
|
||
const BreakpointsComponent = React.createFactory(Breakpoints.WrappedComponent); | ||
|
||
function generateDefaults(overrides) { | ||
const sourceId = "server1.conn1.child1/source1"; | ||
const matchingBreakpoints = { id1: { location: { sourceId } } }; | ||
|
||
return { | ||
selectedSource: { sourceId, get: () => false }, | ||
editor: { | ||
codeMirror: { | ||
setGutterMarker: jest.fn() | ||
} | ||
}, | ||
breakpoints: I.Map(matchingBreakpoints), | ||
...overrides | ||
}; | ||
} | ||
|
||
function render(overrides = {}) { | ||
const props = generateDefaults(overrides); | ||
const component = shallow(new BreakpointsComponent(props)); | ||
return { component, props }; | ||
} | ||
|
||
describe("Breakpoints Component", () => { | ||
it("should render breakpoints without columns", async () => { | ||
const sourceId = "server1.conn1.child1/source1"; | ||
const breakpoints = I.Map({ id1: { location: { sourceId } } }); | ||
|
||
const { component, props } = render({ breakpoints }); | ||
expect(component.find("Breakpoint").length).toBe(props.breakpoints.size); | ||
}); | ||
|
||
it("should render breakpoints with columns", async () => { | ||
const sourceId = "server1.conn1.child1/source1"; | ||
const breakpoints = I.Map({ id1: { location: { column: 2, sourceId } } }); | ||
|
||
const { component, props } = render({ breakpoints }); | ||
expect(component.find("Breakpoint").length).toBe(props.breakpoints.size); | ||
expect(component).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.