mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-01 06:35:42 +00:00
Bug 1284843 - Reps: Don't add quotes around strings. r=linclark
--HG-- extra : amend_source : 6b1ad815c9c3696f5b4c81a2b31809eec02d0d7e
This commit is contained in:
parent
f806b3f7de
commit
c5639fb958
@ -35,8 +35,11 @@ define(function (require, exports, module) {
|
||||
let croppedString = this.props.cropLimit ?
|
||||
cropMultipleLines(text, this.props.cropLimit) : cropMultipleLines(text);
|
||||
|
||||
let formattedString = this.props.omitQuotes ?
|
||||
croppedString : "\"" + croppedString + "\"";
|
||||
|
||||
return (
|
||||
span({className: "objectBox objectBox-string"}, "\"" + croppedString + "\""
|
||||
span({className: "objectBox objectBox-string"}, formattedString
|
||||
)
|
||||
);
|
||||
},
|
||||
|
@ -27,6 +27,7 @@ window.onload = Task.async(function* () {
|
||||
yield testMultiline();
|
||||
yield testMultilineOpen();
|
||||
yield testMultilineLimit();
|
||||
yield testOmitQuotes();
|
||||
} catch(e) {
|
||||
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
||||
} finally {
|
||||
@ -48,10 +49,18 @@ window.onload = Task.async(function* () {
|
||||
is(renderedComponent.textContent, "\"aaaaaaaaaaaaaaaaaaaaa\nbbbbbbbbbbbbbbbbbbb\ncccccccccccccccc\n\"", "String rep has expected text content for multiline string when open");
|
||||
}
|
||||
|
||||
function testOmitQuotes(){
|
||||
const renderedComponent = renderComponent(StringRep.rep, { object: getGripStub("testOmitQuotes"), omitQuotes: true });
|
||||
is(renderedComponent.textContent, "abc","String rep has expected to omit quotes");
|
||||
}
|
||||
|
||||
function getGripStub(name) {
|
||||
switch (name) {
|
||||
case "testMultiline":
|
||||
return "aaaaaaaaaaaaaaaaaaaaa\nbbbbbbbbbbbbbbbbbbb\ncccccccccccccccc\n";
|
||||
return "aaaaaaaaaaaaaaaaaaaaa\nbbbbbbbbbbbbbbbbbbb\ncccccccccccccccc\n";
|
||||
break;
|
||||
case "testOmitQuotes":
|
||||
return "abc";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user