зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1574831 - Pass the object to onDOMNodeMouseOut in the reps. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D42444 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
0e392d0f13
Коммит
31be15ff62
|
@ -65,7 +65,7 @@ function ElementNode(props) {
|
|||
|
||||
if (onDOMNodeMouseOut) {
|
||||
Object.assign(baseConfig, {
|
||||
onMouseOut: onDOMNodeMouseOut,
|
||||
onMouseOut: _ => onDOMNodeMouseOut(object),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -160,6 +160,7 @@ describe("ElementNode - Node", () => {
|
|||
renderedComponent.simulate("mouseout");
|
||||
|
||||
expect(onDOMNodeMouseOut.mock.calls).toHaveLength(1);
|
||||
expect(onDOMNodeMouseOut.mock.calls[0][0]).toEqual(stub);
|
||||
});
|
||||
|
||||
it("calls the expected function when mouseover is fired on Rep", () => {
|
||||
|
|
|
@ -126,6 +126,7 @@ describe("Event - mouse event", () => {
|
|||
node.simulate("mouseout");
|
||||
|
||||
expect(onDOMNodeMouseOut.mock.calls).toHaveLength(1);
|
||||
expect(onDOMNodeMouseOut.mock.calls[0][0]).toEqual(grips[0]);
|
||||
});
|
||||
|
||||
it("calls the expected function when mouseover is fired on Rep", () => {
|
||||
|
|
|
@ -386,6 +386,9 @@ describe("GripArray - NodeList", () => {
|
|||
node.at(2).simulate("mouseout");
|
||||
|
||||
expect(onDOMNodeMouseOut.mock.calls).toHaveLength(3);
|
||||
expect(onDOMNodeMouseOut.mock.calls[0][0]).toBe(grips[0]);
|
||||
expect(onDOMNodeMouseOut.mock.calls[1][0]).toBe(grips[1]);
|
||||
expect(onDOMNodeMouseOut.mock.calls[2][0]).toBe(grips[2]);
|
||||
});
|
||||
|
||||
it("calls the expected function on click", () => {
|
||||
|
|
|
@ -147,6 +147,7 @@ describe("GripMapEntry - complex", () => {
|
|||
|
||||
node.simulate("mouseout");
|
||||
expect(onDOMNodeMouseOut.mock.calls).toHaveLength(1);
|
||||
expect(onDOMNodeMouseOut.mock.calls[0][0]).toEqual(stub);
|
||||
|
||||
node.simulate("mouseover");
|
||||
expect(onDOMNodeMouseOver.mock.calls).toHaveLength(1);
|
||||
|
@ -172,6 +173,7 @@ describe("GripMapEntry - complex", () => {
|
|||
|
||||
node.simulate("mouseout");
|
||||
expect(onDOMNodeMouseOut.mock.calls).toHaveLength(2);
|
||||
expect(onDOMNodeMouseOut.mock.calls[1][0]).toEqual(stub);
|
||||
|
||||
node.simulate("mouseover");
|
||||
expect(onDOMNodeMouseOver.mock.calls).toHaveLength(2);
|
||||
|
|
|
@ -236,6 +236,9 @@ describe("GripMap - Node-keyed entries", () => {
|
|||
node.at(2).simulate("mouseout");
|
||||
|
||||
expect(onDOMNodeMouseOut.mock.calls).toHaveLength(3);
|
||||
expect(onDOMNodeMouseOut.mock.calls[0][0]).toBe(grips[0]);
|
||||
expect(onDOMNodeMouseOut.mock.calls[1][0]).toBe(grips[1]);
|
||||
expect(onDOMNodeMouseOut.mock.calls[2][0]).toBe(grips[2]);
|
||||
});
|
||||
|
||||
it("calls the expected function on click", () => {
|
||||
|
@ -292,6 +295,9 @@ describe("GripMap - Node-valued entries", () => {
|
|||
node.at(2).simulate("mouseout");
|
||||
|
||||
expect(onDOMNodeMouseOut.mock.calls).toHaveLength(3);
|
||||
expect(onDOMNodeMouseOut.mock.calls[0][0]).toBe(grips[0]);
|
||||
expect(onDOMNodeMouseOut.mock.calls[1][0]).toBe(grips[1]);
|
||||
expect(onDOMNodeMouseOut.mock.calls[2][0]).toBe(grips[2]);
|
||||
});
|
||||
|
||||
it("calls the expected function on click", () => {
|
||||
|
|
|
@ -380,6 +380,8 @@ describe("Grip - Object with connected nodes", () => {
|
|||
node.at(1).simulate("mouseout");
|
||||
|
||||
expect(onDOMNodeMouseOut.mock.calls).toHaveLength(2);
|
||||
expect(onDOMNodeMouseOut.mock.calls[0][0]).toBe(grips[0]);
|
||||
expect(onDOMNodeMouseOut.mock.calls[1][0]).toBe(grips[1]);
|
||||
});
|
||||
|
||||
it("calls the expected function on click", () => {
|
||||
|
|
|
@ -129,6 +129,7 @@ describe("Promise - fulfilled with node", () => {
|
|||
node.simulate("mouseout");
|
||||
|
||||
expect(onDOMNodeMouseOut.mock.calls).toHaveLength(1);
|
||||
expect(onDOMNodeMouseOut).toHaveBeenCalledWith(grips[0]);
|
||||
});
|
||||
|
||||
it("no inspect icon when the node is not connected to the DOM tree", () => {
|
||||
|
|
|
@ -70,6 +70,7 @@ describe("TextNode", () => {
|
|||
wrapper.simulate("mouseout");
|
||||
|
||||
expect(onDOMNodeMouseOut.mock.calls).toHaveLength(1);
|
||||
expect(onDOMNodeMouseOut).toHaveBeenCalledWith(object);
|
||||
});
|
||||
|
||||
it("displays a button when the node is connected", () => {
|
||||
|
|
|
@ -49,7 +49,7 @@ function TextNode(props) {
|
|||
|
||||
if (onDOMNodeMouseOut) {
|
||||
Object.assign(baseConfig, {
|
||||
onMouseOut: onDOMNodeMouseOut,
|
||||
onMouseOut: _ => onDOMNodeMouseOut(grip),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -6925,7 +6925,7 @@ function ElementNode(props) {
|
|||
|
||||
if (onDOMNodeMouseOut) {
|
||||
Object.assign(baseConfig, {
|
||||
onMouseOut: onDOMNodeMouseOut
|
||||
onMouseOut: _ => onDOMNodeMouseOut(object)
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -7112,7 +7112,7 @@ function TextNode(props) {
|
|||
|
||||
if (onDOMNodeMouseOut) {
|
||||
Object.assign(baseConfig, {
|
||||
onMouseOut: onDOMNodeMouseOut
|
||||
onMouseOut: _ => onDOMNodeMouseOut(grip)
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче