forked from mirrors/gecko-dev
Bug 1787113 - [devtools] Move createGripMapEntry to reps test helper. r=ochameau.
The function is only used in tests, there's no need for it to be in the Rep. Differential Revision: https://phabricator.services.mozilla.com/D155562
This commit is contained in:
parent
d714558ef6
commit
ac589ea41d
7 changed files with 28 additions and 20 deletions
|
|
@ -69,20 +69,9 @@ define(function(require, exports, module) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function createGripMapEntry(key, value) {
|
|
||||||
return {
|
|
||||||
type: "mapEntry",
|
|
||||||
preview: {
|
|
||||||
key,
|
|
||||||
value,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Exports from this module
|
// Exports from this module
|
||||||
module.exports = {
|
module.exports = {
|
||||||
rep: wrapRender(GripEntry),
|
rep: wrapRender(GripEntry),
|
||||||
createGripMapEntry,
|
|
||||||
supportsObject,
|
supportsObject,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,9 @@ const {
|
||||||
|
|
||||||
const { shouldLoadItemIndexedProperties } = Utils.loadProperties;
|
const { shouldLoadItemIndexedProperties } = Utils.loadProperties;
|
||||||
|
|
||||||
const GripEntryRep = require("devtools/client/shared/components/reps/reps/grip-entry");
|
const {
|
||||||
|
createGripMapEntry,
|
||||||
|
} = require("devtools/client/shared/components/test/node/components/reps/test-helpers");
|
||||||
const accessorStubs = require("devtools/client/shared/components/test/node/stubs/reps/accessor");
|
const accessorStubs = require("devtools/client/shared/components/test/node/stubs/reps/accessor");
|
||||||
const gripMapStubs = require("devtools/client/shared/components/test/node/stubs/reps/grip-map");
|
const gripMapStubs = require("devtools/client/shared/components/test/node/stubs/reps/grip-map");
|
||||||
const gripArrayStubs = require("devtools/client/shared/components/test/node/stubs/reps/grip-array");
|
const gripArrayStubs = require("devtools/client/shared/components/test/node/stubs/reps/grip-array");
|
||||||
|
|
@ -189,7 +191,7 @@ describe("shouldLoadItemIndexedProperties", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("returns false for a MapEntry node", () => {
|
it("returns false for a MapEntry node", () => {
|
||||||
const node = GripEntryRep.createGripMapEntry("key", "value");
|
const node = createGripMapEntry("key", "value");
|
||||||
expect(shouldLoadItemIndexedProperties(node)).toBeFalsy();
|
expect(shouldLoadItemIndexedProperties(node)).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,9 @@ const {
|
||||||
|
|
||||||
const { shouldLoadItemNonIndexedProperties } = Utils.loadProperties;
|
const { shouldLoadItemNonIndexedProperties } = Utils.loadProperties;
|
||||||
|
|
||||||
const GripEntryRep = require("devtools/client/shared/components/reps/reps/grip-entry");
|
const {
|
||||||
|
createGripMapEntry,
|
||||||
|
} = require("devtools/client/shared/components/test/node/components/reps/test-helpers");
|
||||||
const accessorStubs = require("devtools/client/shared/components/test/node/stubs/reps/accessor");
|
const accessorStubs = require("devtools/client/shared/components/test/node/stubs/reps/accessor");
|
||||||
const gripMapStubs = require("devtools/client/shared/components/test/node/stubs/reps/grip-map");
|
const gripMapStubs = require("devtools/client/shared/components/test/node/stubs/reps/grip-map");
|
||||||
const gripArrayStubs = require("devtools/client/shared/components/test/node/stubs/reps/grip-array");
|
const gripArrayStubs = require("devtools/client/shared/components/test/node/stubs/reps/grip-array");
|
||||||
|
|
@ -152,7 +154,7 @@ describe("shouldLoadItemNonIndexedProperties", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("returns false for a MapEntry node", () => {
|
it("returns false for a MapEntry node", () => {
|
||||||
const node = GripEntryRep.createGripMapEntry("key", "value");
|
const node = createGripMapEntry("key", "value");
|
||||||
expect(shouldLoadItemNonIndexedProperties(node)).toBeFalsy();
|
expect(shouldLoadItemNonIndexedProperties(node)).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,9 @@ const {
|
||||||
|
|
||||||
const { shouldLoadItemPrototype } = Utils.loadProperties;
|
const { shouldLoadItemPrototype } = Utils.loadProperties;
|
||||||
|
|
||||||
const GripEntryRep = require("devtools/client/shared/components/reps/reps/grip-entry");
|
const {
|
||||||
|
createGripMapEntry,
|
||||||
|
} = require("devtools/client/shared/components/test/node/components/reps/test-helpers");
|
||||||
const accessorStubs = require("devtools/client/shared/components/test/node/stubs/reps/accessor");
|
const accessorStubs = require("devtools/client/shared/components/test/node/stubs/reps/accessor");
|
||||||
const gripMapStubs = require("devtools/client/shared/components/test/node/stubs/reps/grip-map");
|
const gripMapStubs = require("devtools/client/shared/components/test/node/stubs/reps/grip-map");
|
||||||
const gripArrayStubs = require("devtools/client/shared/components/test/node/stubs/reps/grip-array");
|
const gripArrayStubs = require("devtools/client/shared/components/test/node/stubs/reps/grip-array");
|
||||||
|
|
@ -148,7 +150,7 @@ describe("shouldLoadItemPrototype", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("returns false for a MapEntry node", () => {
|
it("returns false for a MapEntry node", () => {
|
||||||
const node = GripEntryRep.createGripMapEntry("key", "value");
|
const node = createGripMapEntry("key", "value");
|
||||||
expect(shouldLoadItemPrototype(node)).toBeFalsy();
|
expect(shouldLoadItemPrototype(node)).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,9 @@ const {
|
||||||
|
|
||||||
const { shouldLoadItemSymbols } = Utils.loadProperties;
|
const { shouldLoadItemSymbols } = Utils.loadProperties;
|
||||||
|
|
||||||
const GripEntryRep = require("devtools/client/shared/components/reps/reps/grip-entry");
|
const {
|
||||||
|
createGripMapEntry,
|
||||||
|
} = require("devtools/client/shared/components/test/node/components/reps/test-helpers");
|
||||||
const accessorStubs = require("devtools/client/shared/components/test/node/stubs/reps/accessor");
|
const accessorStubs = require("devtools/client/shared/components/test/node/stubs/reps/accessor");
|
||||||
const gripMapStubs = require("devtools/client/shared/components/test/node/stubs/reps/grip-map");
|
const gripMapStubs = require("devtools/client/shared/components/test/node/stubs/reps/grip-map");
|
||||||
const gripArrayStubs = require("devtools/client/shared/components/test/node/stubs/reps/grip-array");
|
const gripArrayStubs = require("devtools/client/shared/components/test/node/stubs/reps/grip-array");
|
||||||
|
|
@ -148,7 +150,7 @@ describe("shouldLoadItemSymbols", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("returns false for a MapEntry node", () => {
|
it("returns false for a MapEntry node", () => {
|
||||||
const node = GripEntryRep.createGripMapEntry("key", "value");
|
const node = createGripMapEntry("key", "value");
|
||||||
expect(shouldLoadItemSymbols(node)).toBeFalsy();
|
expect(shouldLoadItemSymbols(node)).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,11 @@ const {
|
||||||
} = require("devtools/client/shared/components/reps/reps/rep");
|
} = require("devtools/client/shared/components/reps/reps/rep");
|
||||||
|
|
||||||
const { GripEntry } = REPS;
|
const { GripEntry } = REPS;
|
||||||
const { createGripMapEntry } = GripEntry;
|
|
||||||
const {
|
const {
|
||||||
MODE,
|
MODE,
|
||||||
} = require("devtools/client/shared/components/reps/reps/constants");
|
} = require("devtools/client/shared/components/reps/reps/constants");
|
||||||
const {
|
const {
|
||||||
|
createGripMapEntry,
|
||||||
getGripLengthBubbleText,
|
getGripLengthBubbleText,
|
||||||
} = require("devtools/client/shared/components/test/node/components/reps/test-helpers");
|
} = require("devtools/client/shared/components/test/node/components/reps/test-helpers");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,18 @@ function getMapLengthBubbleText(object, props) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function createGripMapEntry(key, value) {
|
||||||
|
return {
|
||||||
|
type: "mapEntry",
|
||||||
|
preview: {
|
||||||
|
key,
|
||||||
|
value,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
createGripMapEntry,
|
||||||
expectActorAttribute,
|
expectActorAttribute,
|
||||||
getSelectableInInspectorGrips,
|
getSelectableInInspectorGrips,
|
||||||
getGripLengthBubbleText,
|
getGripLengthBubbleText,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue