[Widget Inspector] Only include truncated
field in JSON response if true
(#159701)
Work towards https://github.com/flutter/devtools/issues/8582 Follow up to https://github.com/flutter/flutter/pull/159454 Only include the `truncated` field if it is `true`. We accidentally were including it even when `false` which is what caused the regression in the DevTools tests.
This commit is contained in:
parent
1b048b0219
commit
8106f2ad1c
@ -1892,7 +1892,8 @@ abstract class DiagnosticsNode {
|
||||
// description instead, see:
|
||||
// https://github.com/flutter/devtools/issues/8556
|
||||
'widgetRuntimeType': widgetRuntimeType,
|
||||
'truncated': truncated,
|
||||
if (truncated)
|
||||
'truncated': truncated,
|
||||
...delegate.additionalNodeProperties(this, fullDetails: false),
|
||||
if (includeChildren) 'children': childrenJsonList,
|
||||
};
|
||||
|
@ -130,6 +130,12 @@ void main() {
|
||||
reason: '$keyName is not included.',
|
||||
);
|
||||
}
|
||||
|
||||
// The truncated value should not be included if it is false.
|
||||
expect(
|
||||
result['truncated'] == null || result['truncated'] == true,
|
||||
isTrue,
|
||||
);
|
||||
});
|
||||
|
||||
test('subtreeDepth 1', () {
|
||||
|
Loading…
x
Reference in New Issue
Block a user