ember-inspector 4.4.1 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +1 -0
- package/.eslintrc.js +20 -12
- package/.github/workflows/build.yml +1 -0
- package/.tool-versions +1 -0
- package/CHANGELOG.md +31 -2
- package/app/{templates → components}/component-tree-toolbar.hbs +5 -5
- package/app/{templates → components}/container-type-toolbar.hbs +3 -3
- package/app/{templates/container-types/index-toolbar.hbs → components/container-types-toolbar.hbs} +2 -2
- package/app/components/date-property-field.js +4 -10
- package/app/{templates → components}/deprecations-toolbar.hbs +4 -4
- package/app/{templates → components}/libraries-toolbar.hbs +0 -0
- package/app/{templates → components}/model-types-toolbar.hbs +4 -4
- package/app/{templates → components}/promise-tree-toolbar.hbs +13 -13
- package/app/components/records-toolbar.hbs +26 -0
- package/app/components/render-tree-toolbar.hbs +33 -0
- package/app/components/route-cell-name.js +1 -1
- package/app/{templates → components}/route-tree-toolbar.hbs +3 -3
- package/app/components/scroll-container.js +3 -1
- package/app/computed/debounce.js +1 -3
- package/app/controllers/deprecations.js +1 -0
- package/app/controllers/render-tree.js +19 -4
- package/app/controllers/route-tree.js +51 -44
- package/app/initializers/setup.js +7 -18
- package/app/models/promise.js +3 -4
- package/app/routes/application.js +2 -14
- package/app/routes/component-tree.js +3 -0
- package/app/routes/deprecations.js +4 -0
- package/app/routes/launch.js +1 -0
- package/app/routes/libraries.js +1 -0
- package/app/routes/promise-tree.js +6 -0
- package/app/routes/render-tree.js +27 -10
- package/app/routes/route-tree.js +3 -2
- package/app/routes/tab.js +9 -9
- package/app/routes/whats-new.js +2 -0
- package/app/{adapters → services/adapters}/basic.js +3 -3
- package/app/{adapters → services/adapters}/bookmarklet.js +0 -0
- package/app/{adapters → services/adapters}/chrome.js +0 -0
- package/app/{adapters → services/adapters}/firefox.js +0 -0
- package/app/{adapters → services/adapters}/web-extension.js +0 -0
- package/app/{adapters → services/adapters}/websocket.js +0 -0
- package/app/services/port.js +3 -2
- package/app/templates/application.hbs +1 -1
- package/app/templates/component-tree.hbs +20 -4
- package/app/templates/container-type.hbs +10 -0
- package/app/templates/container-types/index.hbs +10 -0
- package/app/templates/deprecations.hbs +13 -10
- package/app/templates/libraries.hbs +12 -11
- package/app/templates/model-types.hbs +15 -2
- package/app/templates/promise-tree.hbs +22 -7
- package/app/templates/records.hbs +15 -7
- package/app/templates/render-tree.hbs +32 -9
- package/app/templates/route-tree.hbs +23 -14
- package/app/templates/whats-new.hbs +8 -4
- package/config/ember-cli-update.json +1 -1
- package/config/ember-try.js +8 -0
- package/config/targets.js +14 -6
- package/dist/bookmarklet/panes-3-4-0/assets/chunk.143.701794df61367d9c0beb.js +146 -0
- package/dist/bookmarklet/panes-3-4-0/assets/chunk.178.1fa501a69a8888639ff4.js +20 -0
- package/dist/bookmarklet/panes-3-4-0/assets/chunk.916.cfdae71ef87e943d7ad0.js +505 -0
- package/dist/bookmarklet/panes-3-4-0/assets/chunk.916.cfdae71ef87e943d7ad0.js.LICENSE.txt +8 -0
- package/dist/bookmarklet/panes-3-4-0/assets/ember-inspector.js +617 -1512
- package/dist/bookmarklet/panes-3-4-0/assets/vendor.css +9 -2
- package/dist/bookmarklet/panes-3-4-0/assets/vendor.js +6132 -7501
- package/dist/bookmarklet/panes-3-4-0/ember_debug.js +731 -416
- package/dist/bookmarklet/panes-3-4-0/index.html +2 -1
- package/dist/chrome/manifest.json +1 -1
- package/dist/chrome/panes-3-4-0/assets/chunk.143.701794df61367d9c0beb.js +146 -0
- package/dist/chrome/panes-3-4-0/assets/chunk.178.1fa501a69a8888639ff4.js +20 -0
- package/dist/chrome/panes-3-4-0/assets/chunk.916.cfdae71ef87e943d7ad0.js +505 -0
- package/dist/chrome/panes-3-4-0/assets/chunk.916.cfdae71ef87e943d7ad0.js.LICENSE.txt +8 -0
- package/dist/chrome/panes-3-4-0/assets/ember-inspector.js +617 -1512
- package/dist/chrome/panes-3-4-0/assets/vendor.css +9 -2
- package/dist/chrome/panes-3-4-0/assets/vendor.js +6132 -7501
- package/dist/chrome/panes-3-4-0/ember_debug.js +731 -416
- package/dist/chrome/panes-3-4-0/index.html +2 -1
- package/dist/firefox/manifest.json +1 -1
- package/dist/firefox/panes-3-4-0/assets/chunk.143.701794df61367d9c0beb.js +146 -0
- package/dist/firefox/panes-3-4-0/assets/chunk.178.1fa501a69a8888639ff4.js +20 -0
- package/dist/firefox/panes-3-4-0/assets/chunk.916.cfdae71ef87e943d7ad0.js +505 -0
- package/dist/firefox/panes-3-4-0/assets/chunk.916.cfdae71ef87e943d7ad0.js.LICENSE.txt +8 -0
- package/dist/firefox/panes-3-4-0/assets/ember-inspector.js +617 -1512
- package/dist/firefox/panes-3-4-0/assets/vendor.css +9 -2
- package/dist/firefox/panes-3-4-0/assets/vendor.js +6132 -7501
- package/dist/firefox/panes-3-4-0/ember_debug.js +731 -416
- package/dist/firefox/panes-3-4-0/index.html +2 -1
- package/dist/websocket/assets/chunk.143.701794df61367d9c0beb.js +146 -0
- package/dist/websocket/assets/chunk.178.1fa501a69a8888639ff4.js +20 -0
- package/dist/websocket/assets/chunk.916.cfdae71ef87e943d7ad0.js +505 -0
- package/dist/websocket/assets/chunk.916.cfdae71ef87e943d7ad0.js.LICENSE.txt +8 -0
- package/dist/websocket/assets/ember-inspector.js +617 -1512
- package/dist/websocket/assets/vendor.css +9 -2
- package/dist/websocket/assets/vendor.js +6132 -7501
- package/dist/websocket/ember_debug.js +731 -416
- package/dist/websocket/index.html +2 -1
- package/ember_debug/adapters/basic.js +4 -3
- package/ember_debug/adapters/web-extension.js +2 -1
- package/ember_debug/adapters/websocket.js +4 -7
- package/ember_debug/container-debug.js +2 -3
- package/ember_debug/data-debug.js +4 -3
- package/ember_debug/deprecation-debug.js +12 -15
- package/ember_debug/general-debug.js +3 -4
- package/ember_debug/libs/promise-assembler.js +12 -14
- package/ember_debug/libs/source-map.js +3 -8
- package/ember_debug/main.js +11 -11
- package/ember_debug/mixins/port-mixin.js +1 -3
- package/ember_debug/models/profile-manager.js +135 -3
- package/ember_debug/models/profile-node.js +2 -4
- package/ember_debug/models/promise.js +3 -4
- package/ember_debug/object-inspector.js +15 -19
- package/ember_debug/port.js +7 -5
- package/ember_debug/promise-debug.js +16 -17
- package/ember_debug/render-debug.js +11 -4
- package/ember_debug/route-debug.js +5 -10
- package/ember_debug/services/session.js +1 -3
- package/ember_debug/utils/ember/application.js +11 -0
- package/ember_debug/utils/ember/array/index.js +11 -0
- package/ember_debug/utils/ember/array/mutable.js +11 -0
- package/ember_debug/utils/ember/array/proxy.js +11 -0
- package/ember_debug/utils/ember/component.js +11 -0
- package/ember_debug/utils/ember/debug.js +15 -0
- package/ember_debug/utils/{ember.js → ember/index.js} +1 -0
- package/ember_debug/utils/ember/instrumentation.js +11 -0
- package/ember_debug/utils/ember/object/computed.js +11 -0
- package/ember_debug/utils/ember/object/evented.js +11 -0
- package/ember_debug/utils/ember/object/index.js +15 -0
- package/ember_debug/utils/ember/object/internals.js +11 -0
- package/ember_debug/utils/ember/object/mixin.js +11 -0
- package/ember_debug/utils/ember/object/observable.js +11 -0
- package/ember_debug/utils/ember/object/promise-proxy-mixin.js +13 -0
- package/ember_debug/utils/ember/runloop.js +17 -0
- package/ember_debug/utils/ember/utils.js +11 -0
- package/ember_debug/utils/rsvp.js +14 -0
- package/ember_debug/vendor/startup-wrapper.js +21 -12
- package/ember_debug/view-debug.js +2 -3
- package/package.json +43 -37
- package/tests/acceptance/app-picker-test.js +3 -3
- package/tests/acceptance/component-tree-test.js +17 -3
- package/tests/acceptance/container-test.js +8 -6
- package/tests/acceptance/data-test.js +2 -0
- package/tests/acceptance/deprecation-test.js +4 -0
- package/tests/acceptance/object-inspector-test.js +29 -1
- package/tests/acceptance/promise-test.js +11 -1
- package/tests/acceptance/route-tree-test.js +10 -0
- package/tests/acceptance/whats-new-test.js +1 -1
- package/tests/ember_debug/ember-debug-test.js +2 -0
- package/tests/ember_debug/object-inspector-test.js +54 -22
- package/tests/ember_debug/profile-manager-test.js +563 -6
- package/tests/ember_debug/profile-node-test.js +5 -5
- package/tests/ember_debug/promise-assembler-test.js +2 -0
- package/tests/ember_debug/promise-debug-test.js +7 -5
- package/tests/ember_debug/render-debug-test.js +1 -1
- package/tests/ember_debug/view-debug-test.js +8 -8
- package/tests/helpers/setup-ember-debug-test.js +11 -6
- package/tests/index.html +8 -1
- package/tests/integration/components/component-tree-arg-test.js +1 -1
- package/tests/test-adapter.js +1 -1
- package/tests/test-helper.js +5 -1
- package/tests/unit/check-current-route-test.js +4 -0
- package/tests/unit/is-route-substate-test.js +8 -8
- package/tests/unit/match-test.js +2 -2
- package/app/templates/records-toolbar.hbs +0 -26
- package/app/templates/render-tree-toolbar.hbs +0 -20
- package/tests/.eslintrc.js +0 -8
|
@@ -209,6 +209,8 @@ module('Component Tab', function (hooks) {
|
|
|
209
209
|
});
|
|
210
210
|
|
|
211
211
|
test('It allows users to navigate nodes with arrow keys', async function (assert) {
|
|
212
|
+
assert.expect(3);
|
|
213
|
+
|
|
212
214
|
await visit('/component-tree');
|
|
213
215
|
|
|
214
216
|
// select first node with down arrow key
|
|
@@ -329,11 +331,13 @@ module('Component Tab', function (hooks) {
|
|
|
329
331
|
});
|
|
330
332
|
|
|
331
333
|
test('Previewing / showing a view on the client', async function (assert) {
|
|
334
|
+
assert.expect(2);
|
|
335
|
+
|
|
332
336
|
await visit('/component-tree');
|
|
333
337
|
|
|
334
338
|
respondWith('view:showInspection', ({ id, pin }) => {
|
|
335
339
|
assert.equal(id, 'render-node:1', 'application route');
|
|
336
|
-
assert.
|
|
340
|
+
assert.false(pin, 'preview only');
|
|
337
341
|
return false;
|
|
338
342
|
});
|
|
339
343
|
|
|
@@ -345,6 +349,8 @@ module('Component Tab', function (hooks) {
|
|
|
345
349
|
});
|
|
346
350
|
|
|
347
351
|
test('Scrolling an element into view', async function (assert) {
|
|
352
|
+
assert.expect(1);
|
|
353
|
+
|
|
348
354
|
await visit('/component-tree');
|
|
349
355
|
|
|
350
356
|
respondWith('view:scrollIntoView', ({ id }) => {
|
|
@@ -356,6 +362,8 @@ module('Component Tab', function (hooks) {
|
|
|
356
362
|
});
|
|
357
363
|
|
|
358
364
|
test('View DOM element in Elements panel', async function (assert) {
|
|
365
|
+
assert.expect(1);
|
|
366
|
+
|
|
359
367
|
await visit('/component-tree');
|
|
360
368
|
|
|
361
369
|
respondWith('view:inspectElement', ({ id }) => {
|
|
@@ -367,11 +375,13 @@ module('Component Tab', function (hooks) {
|
|
|
367
375
|
});
|
|
368
376
|
|
|
369
377
|
test('Inspects the component in the object inspector on click and shows tooltip', async function (assert) {
|
|
378
|
+
assert.expect(3);
|
|
379
|
+
|
|
370
380
|
await visit('/component-tree');
|
|
371
381
|
|
|
372
382
|
respondWith('view:showInspection', ({ id, pin }) => {
|
|
373
383
|
assert.equal(id, 'render-node:3', '<TodoList>');
|
|
374
|
-
assert.
|
|
384
|
+
assert.true(pin, 'pin');
|
|
375
385
|
return false;
|
|
376
386
|
});
|
|
377
387
|
|
|
@@ -388,12 +398,14 @@ module('Component Tab', function (hooks) {
|
|
|
388
398
|
});
|
|
389
399
|
|
|
390
400
|
test('Selects a component in the tree in response to a message from the context menu', async function (assert) {
|
|
401
|
+
assert.expect(5);
|
|
402
|
+
|
|
391
403
|
// Go to the component tree and populate it before sending the message from the context menu
|
|
392
404
|
await visit('/component-tree');
|
|
393
405
|
|
|
394
406
|
respondWith('view:showInspection', ({ id, pin }) => {
|
|
395
407
|
assert.equal(id, 'render-node:3', '<TodoList>');
|
|
396
|
-
assert.
|
|
408
|
+
assert.true(pin, 'pin');
|
|
397
409
|
return false;
|
|
398
410
|
});
|
|
399
411
|
|
|
@@ -425,6 +437,8 @@ module('Component Tab', function (hooks) {
|
|
|
425
437
|
});
|
|
426
438
|
|
|
427
439
|
test('Can inspect component arguments that are objects in component tree', async function (assert) {
|
|
440
|
+
assert.expect(1);
|
|
441
|
+
|
|
428
442
|
await visit('/component-tree');
|
|
429
443
|
|
|
430
444
|
respondWith('objectInspector:inspectById', ({ objectId }) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import TestAdapter from '@ember/test/adapter';
|
|
2
2
|
import { module, test } from 'qunit';
|
|
3
3
|
import { setupApplicationTest } from 'ember-qunit';
|
|
4
|
-
import { visit, findAll, click, fillIn, currentURL } from 'ember
|
|
4
|
+
import { visit, findAll, click, fillIn, currentURL } from '@ember/test-helpers';
|
|
5
5
|
import { setupTestAdapter, respondWith } from '../test-adapter';
|
|
6
6
|
|
|
7
7
|
function getTypes() {
|
|
@@ -161,6 +161,8 @@ module('Container Tab', function (outer) {
|
|
|
161
161
|
});
|
|
162
162
|
|
|
163
163
|
test('Successfully redirects if the container type is not found', async function (assert) {
|
|
164
|
+
assert.expect(1);
|
|
165
|
+
|
|
164
166
|
respondWith('container:getInstances', ({ containerType }) => {
|
|
165
167
|
if (containerType === 'random-type') {
|
|
166
168
|
return {
|
|
@@ -170,13 +172,13 @@ module('Container Tab', function (outer) {
|
|
|
170
172
|
}
|
|
171
173
|
});
|
|
172
174
|
|
|
173
|
-
let adapterException =
|
|
175
|
+
let adapterException = TestAdapter.exception;
|
|
174
176
|
|
|
175
177
|
// Failed route causes a promise unhandled rejection
|
|
176
178
|
// even though there's an `error` action defined :(
|
|
177
|
-
|
|
179
|
+
TestAdapter.exception = (err) => {
|
|
178
180
|
if (!err || err.status !== 404) {
|
|
179
|
-
return adapterException.call(
|
|
181
|
+
return adapterException.call(TestAdapter, err);
|
|
180
182
|
}
|
|
181
183
|
};
|
|
182
184
|
|
|
@@ -184,7 +186,7 @@ module('Container Tab', function (outer) {
|
|
|
184
186
|
await visit('/container-types/random-type');
|
|
185
187
|
assert.equal(currentURL(), '/container-types');
|
|
186
188
|
} finally {
|
|
187
|
-
|
|
189
|
+
TestAdapter.exception = adapterException;
|
|
188
190
|
}
|
|
189
191
|
});
|
|
190
192
|
});
|
|
@@ -90,6 +90,8 @@ module('Deprecation Tab', function (outer) {
|
|
|
90
90
|
});
|
|
91
91
|
|
|
92
92
|
test('No source map', async function (assert) {
|
|
93
|
+
assert.expect(6);
|
|
94
|
+
|
|
93
95
|
await visit('/deprecations');
|
|
94
96
|
|
|
95
97
|
await toggleDeprecationSource();
|
|
@@ -129,6 +131,8 @@ module('Deprecation Tab', function (outer) {
|
|
|
129
131
|
});
|
|
130
132
|
|
|
131
133
|
test("With source map, source found, can't open resource", async function (assert) {
|
|
134
|
+
assert.expect(12);
|
|
135
|
+
|
|
132
136
|
await visit('/deprecations');
|
|
133
137
|
|
|
134
138
|
await toggleDeprecationSource();
|
|
@@ -165,6 +165,8 @@ module('Object Inspector', function (hooks) {
|
|
|
165
165
|
});
|
|
166
166
|
|
|
167
167
|
test('Digging deeper into objects', async function (assert) {
|
|
168
|
+
assert.expect(8);
|
|
169
|
+
|
|
168
170
|
await visit('/');
|
|
169
171
|
|
|
170
172
|
await sendMessage({
|
|
@@ -572,6 +574,8 @@ module('Object Inspector', function (hooks) {
|
|
|
572
574
|
});
|
|
573
575
|
|
|
574
576
|
test('Send to console', async function (assert) {
|
|
577
|
+
assert.expect(6);
|
|
578
|
+
|
|
575
579
|
await visit('/');
|
|
576
580
|
|
|
577
581
|
await sendMessage({
|
|
@@ -696,6 +700,8 @@ module('Object Inspector', function (hooks) {
|
|
|
696
700
|
});
|
|
697
701
|
|
|
698
702
|
test('Date fields are editable', async function (assert) {
|
|
703
|
+
assert.expect(5);
|
|
704
|
+
|
|
699
705
|
await visit('/');
|
|
700
706
|
|
|
701
707
|
let date = new Date(2019, 7, 13); // 2019-08-13
|
|
@@ -721,6 +727,26 @@ module('Object Inspector', function (hooks) {
|
|
|
721
727
|
],
|
|
722
728
|
});
|
|
723
729
|
|
|
730
|
+
respondWith(
|
|
731
|
+
'objectInspector:saveProperty',
|
|
732
|
+
({ objectId, property, value }) => {
|
|
733
|
+
assert.strictEqual(typeof value, 'number', 'sent as timestamp');
|
|
734
|
+
date = new Date(value);
|
|
735
|
+
|
|
736
|
+
return {
|
|
737
|
+
type: 'objectInspector:updateProperty',
|
|
738
|
+
objectId,
|
|
739
|
+
property,
|
|
740
|
+
mixinIndex: 0,
|
|
741
|
+
value: {
|
|
742
|
+
inspect: date.toString(),
|
|
743
|
+
type: 'type-date',
|
|
744
|
+
isCalculated: false,
|
|
745
|
+
},
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
);
|
|
749
|
+
|
|
724
750
|
await click('[data-test-object-detail-name]');
|
|
725
751
|
|
|
726
752
|
assert.dom('[data-test-object-property-value]').hasText(date.toString());
|
|
@@ -733,7 +759,7 @@ module('Object Inspector', function (hooks) {
|
|
|
733
759
|
respondWith(
|
|
734
760
|
'objectInspector:saveProperty',
|
|
735
761
|
({ objectId, property, value }) => {
|
|
736
|
-
assert.
|
|
762
|
+
assert.strictEqual(typeof value, 'number', 'sent as timestamp');
|
|
737
763
|
date = new Date(value);
|
|
738
764
|
|
|
739
765
|
return {
|
|
@@ -757,6 +783,8 @@ module('Object Inspector', function (hooks) {
|
|
|
757
783
|
});
|
|
758
784
|
|
|
759
785
|
test('Errors are correctly displayed', async function (assert) {
|
|
786
|
+
assert.expect(8);
|
|
787
|
+
|
|
760
788
|
await visit('/');
|
|
761
789
|
|
|
762
790
|
await sendMessage({
|
|
@@ -217,6 +217,8 @@ module('Promise Tab', function (outer) {
|
|
|
217
217
|
|
|
218
218
|
// TODO: is this test realistic? (having stack traces without turning on instrumentWithStack)
|
|
219
219
|
test('Can trace promise when there is a stack', async function (assert) {
|
|
220
|
+
assert.expect(1);
|
|
221
|
+
|
|
220
222
|
respondWith('promise:getAndObservePromises', {
|
|
221
223
|
type: 'promise:promisesUpdated',
|
|
222
224
|
promises: [
|
|
@@ -254,6 +256,8 @@ module('Promise Tab', function (outer) {
|
|
|
254
256
|
});
|
|
255
257
|
|
|
256
258
|
test('Toggling promise trace option', async function (assert) {
|
|
259
|
+
assert.expect(2);
|
|
260
|
+
|
|
257
261
|
respondWith('promise:getAndObservePromises', {
|
|
258
262
|
type: 'promise:promisesUpdated',
|
|
259
263
|
promises: [generatePromise()],
|
|
@@ -267,7 +271,7 @@ module('Promise Tab', function (outer) {
|
|
|
267
271
|
respondWith(
|
|
268
272
|
'promise:setInstrumentWithStack',
|
|
269
273
|
({ applicationId, applicationName, instrumentWithStack }) => {
|
|
270
|
-
assert.
|
|
274
|
+
assert.true(instrumentWithStack, 'instrumentWithStack');
|
|
271
275
|
|
|
272
276
|
return {
|
|
273
277
|
type: 'promise:instrumentWithStack',
|
|
@@ -282,6 +286,8 @@ module('Promise Tab', function (outer) {
|
|
|
282
286
|
});
|
|
283
287
|
|
|
284
288
|
test('Logging error stack trace in the console', async function (assert) {
|
|
289
|
+
assert.expect(2);
|
|
290
|
+
|
|
285
291
|
respondWith('promise:getAndObservePromises', {
|
|
286
292
|
type: 'promise:promisesUpdated',
|
|
287
293
|
promises: [
|
|
@@ -310,6 +316,8 @@ module('Promise Tab', function (outer) {
|
|
|
310
316
|
});
|
|
311
317
|
|
|
312
318
|
test('Send fulfillment value to console', async function (assert) {
|
|
319
|
+
assert.expect(2);
|
|
320
|
+
|
|
313
321
|
respondWith('promise:getAndObservePromises', {
|
|
314
322
|
type: 'promise:promisesUpdated',
|
|
315
323
|
promises: [
|
|
@@ -338,6 +346,8 @@ module('Promise Tab', function (outer) {
|
|
|
338
346
|
});
|
|
339
347
|
|
|
340
348
|
test('Sending objects to the object inspector', async function (assert) {
|
|
349
|
+
assert.expect(1);
|
|
350
|
+
|
|
341
351
|
respondWith('promise:getAndObservePromises', {
|
|
342
352
|
type: 'promise:promisesUpdated',
|
|
343
353
|
promises: [
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
findAll,
|
|
6
6
|
triggerEvent,
|
|
7
7
|
visit,
|
|
8
|
+
waitUntil,
|
|
8
9
|
} from '@ember/test-helpers';
|
|
9
10
|
import { classify } from '@ember/string';
|
|
10
11
|
import { module, test } from 'qunit';
|
|
@@ -106,6 +107,13 @@ module('Route Tree Tab', function (outer) {
|
|
|
106
107
|
test('Route tree is successfully displayed', async function (assert) {
|
|
107
108
|
await visit('route-tree');
|
|
108
109
|
|
|
110
|
+
await waitUntil(
|
|
111
|
+
function () {
|
|
112
|
+
return findAll('.js-route-tree-item').length === 6;
|
|
113
|
+
},
|
|
114
|
+
{ timeout: 2000 }
|
|
115
|
+
);
|
|
116
|
+
|
|
109
117
|
let routeNodes = findAll('.js-route-tree-item');
|
|
110
118
|
assert.equal(routeNodes.length, 6, 'correct number of nodes');
|
|
111
119
|
|
|
@@ -162,6 +170,8 @@ module('Route Tree Tab', function (outer) {
|
|
|
162
170
|
});
|
|
163
171
|
|
|
164
172
|
test('Clicking on route handlers and controller sends an inspection message', async function (assert) {
|
|
173
|
+
assert.expect(2);
|
|
174
|
+
|
|
165
175
|
await visit('route-tree');
|
|
166
176
|
|
|
167
177
|
let applicationRow = find('.js-route-tree-item');
|
|
@@ -49,7 +49,7 @@ module('Whats New', function (outer) {
|
|
|
49
49
|
setupApplicationTest(outer);
|
|
50
50
|
|
|
51
51
|
outer.beforeEach(function () {
|
|
52
|
-
this.config = this.owner.lookup('config
|
|
52
|
+
this.config = this.owner.lookup('service:config');
|
|
53
53
|
this.originalVersion = this.config.version;
|
|
54
54
|
});
|
|
55
55
|
|
|
@@ -31,6 +31,8 @@ module('Ember Debug', function (hooks) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
test('EmberDebug#inspect sends inspectable objects', function (assert) {
|
|
34
|
+
assert.expect(2);
|
|
35
|
+
|
|
34
36
|
let obj = EmberObject.create();
|
|
35
37
|
EmberDebug.inspect(obj);
|
|
36
38
|
assert.equal(name, 'objectInspector:updateObject');
|
|
@@ -19,6 +19,8 @@ import hasEmberVersion from '@ember/test-helpers/has-ember-version';
|
|
|
19
19
|
import { compareVersion } from 'ember-debug/utils/version';
|
|
20
20
|
import EmberDebug from 'ember-debug/main';
|
|
21
21
|
import setupEmberDebugTest from '../helpers/setup-ember-debug-test';
|
|
22
|
+
import EmberRoute from '@ember/routing/route';
|
|
23
|
+
import Controller from '@ember/controller';
|
|
22
24
|
|
|
23
25
|
const GlimmerComponent = (function () {
|
|
24
26
|
try {
|
|
@@ -72,9 +74,25 @@ async function inspectObject(object) {
|
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
module('Ember Debug - Object Inspector', function (hooks) {
|
|
75
|
-
setupEmberDebugTest(hooks
|
|
77
|
+
setupEmberDebugTest(hooks, {
|
|
78
|
+
routes() {
|
|
79
|
+
this.route('simple');
|
|
80
|
+
},
|
|
81
|
+
});
|
|
76
82
|
|
|
77
83
|
hooks.beforeEach(async function () {
|
|
84
|
+
this.owner.register('route:application', EmberRoute);
|
|
85
|
+
|
|
86
|
+
this.owner.register('controller:application', Controller);
|
|
87
|
+
|
|
88
|
+
this.owner.register(
|
|
89
|
+
'template:application',
|
|
90
|
+
hbs(
|
|
91
|
+
'<div class="application" style="line-height: normal;">{{outlet}}</div>',
|
|
92
|
+
{ moduleName: 'my-app/templates/application.hbs' }
|
|
93
|
+
)
|
|
94
|
+
);
|
|
95
|
+
this.owner.register('route:simple', EmberRoute);
|
|
78
96
|
this.owner.register('component:x-simple', Component);
|
|
79
97
|
this.owner.register(
|
|
80
98
|
'template:simple',
|
|
@@ -498,7 +516,7 @@ module('Ember Debug - Object Inspector', function (hooks) {
|
|
|
498
516
|
assert.equal(message.objectId, objectId);
|
|
499
517
|
assert.equal(message.property, 'name');
|
|
500
518
|
assert.equal(message.mixinIndex, 1);
|
|
501
|
-
assert.
|
|
519
|
+
assert.true(message.value.isCalculated);
|
|
502
520
|
assert.equal(message.value.inspect, inspect('Alex'));
|
|
503
521
|
assert.equal(message.value.type, 'type-string');
|
|
504
522
|
|
|
@@ -688,8 +706,9 @@ module('Ember Debug - Object Inspector', function (hooks) {
|
|
|
688
706
|
'Does not calculate expensive properties'
|
|
689
707
|
);
|
|
690
708
|
|
|
691
|
-
assert.
|
|
692
|
-
message.details[3].name
|
|
709
|
+
assert.notStrictEqual(
|
|
710
|
+
message.details[3].name,
|
|
711
|
+
'MixinToSkip',
|
|
693
712
|
'Correctly skips mixins'
|
|
694
713
|
);
|
|
695
714
|
});
|
|
@@ -798,8 +817,9 @@ module('Ember Debug - Object Inspector', function (hooks) {
|
|
|
798
817
|
'Does not calculate expensive properties'
|
|
799
818
|
);
|
|
800
819
|
|
|
801
|
-
assert.
|
|
802
|
-
message.details[3].name
|
|
820
|
+
assert.notStrictEqual(
|
|
821
|
+
message.details[3].name,
|
|
822
|
+
'MixinToSkip',
|
|
803
823
|
'Correctly skips mixins'
|
|
804
824
|
);
|
|
805
825
|
});
|
|
@@ -819,7 +839,7 @@ module('Ember Debug - Object Inspector', function (hooks) {
|
|
|
819
839
|
|
|
820
840
|
let serializedServiceProperty = message.details[1].properties[0];
|
|
821
841
|
|
|
822
|
-
assert.
|
|
842
|
+
assert.true(serializedServiceProperty.isService);
|
|
823
843
|
});
|
|
824
844
|
|
|
825
845
|
test('Proxy Service should be successfully tagged as service on serialization', async function (assert) {
|
|
@@ -837,7 +857,7 @@ module('Ember Debug - Object Inspector', function (hooks) {
|
|
|
837
857
|
|
|
838
858
|
let serializedServiceProperty = message.details[1].properties[0];
|
|
839
859
|
|
|
840
|
-
assert.
|
|
860
|
+
assert.true(serializedServiceProperty.isService);
|
|
841
861
|
});
|
|
842
862
|
|
|
843
863
|
test('Computed property dependent keys and code should be successfully serialized', async function (assert) {
|
|
@@ -901,10 +921,11 @@ module('Ember Debug - Object Inspector', function (hooks) {
|
|
|
901
921
|
});
|
|
902
922
|
|
|
903
923
|
assert.ok(didDestroy, 'Original willDestroy is preserved.');
|
|
904
|
-
assert.
|
|
924
|
+
assert.notOk(objectInspector.sentObjects[objectId], 'Object is dropped');
|
|
905
925
|
assert.deepEqual(message, { objectId });
|
|
906
926
|
});
|
|
907
927
|
|
|
928
|
+
// eslint-disable-next-line qunit/require-expect
|
|
908
929
|
test('Properties ending with `Binding` are skipped', async function (assert) {
|
|
909
930
|
let object = EmberObject.create({
|
|
910
931
|
bar: 'test',
|
|
@@ -1025,7 +1046,7 @@ module('Ember Debug - Object Inspector', function (hooks) {
|
|
|
1025
1046
|
let getter = message.details[1].properties[0];
|
|
1026
1047
|
assert.equal(getter.name, 'hi');
|
|
1027
1048
|
assert.ok(getter.isGetter);
|
|
1028
|
-
assert.
|
|
1049
|
+
assert.notOk(getter.isTracked);
|
|
1029
1050
|
assert.equal(getter.value.type, 'type-number');
|
|
1030
1051
|
assert.equal(getter.value.inspect, '123');
|
|
1031
1052
|
});
|
|
@@ -1114,7 +1135,7 @@ module('Ember Debug - Object Inspector', function (hooks) {
|
|
|
1114
1135
|
test('Inspecting GlimmerComponent does not cause errors', async function (assert) {
|
|
1115
1136
|
let instance;
|
|
1116
1137
|
|
|
1117
|
-
class
|
|
1138
|
+
class Foo extends GlimmerComponent {
|
|
1118
1139
|
constructor(...args) {
|
|
1119
1140
|
super(...args);
|
|
1120
1141
|
instance = this;
|
|
@@ -1131,15 +1152,20 @@ module('Ember Debug - Object Inspector', function (hooks) {
|
|
|
1131
1152
|
}
|
|
1132
1153
|
}
|
|
1133
1154
|
|
|
1134
|
-
this.owner.register('
|
|
1135
|
-
|
|
1155
|
+
this.owner.register('template:simple', hbs`<Foo />`, {
|
|
1156
|
+
moduleName: 'my-app/templates/simple.hbs',
|
|
1157
|
+
});
|
|
1136
1158
|
|
|
1159
|
+
this.owner.register('component:foo', Foo);
|
|
1160
|
+
this.owner.register(
|
|
1161
|
+
`template:components/foo`,
|
|
1162
|
+
hbs('text only', {
|
|
1163
|
+
moduleName: 'my-app/templates/components/foo.hbs',
|
|
1164
|
+
})
|
|
1165
|
+
);
|
|
1137
1166
|
await visit('/simple');
|
|
1138
1167
|
|
|
1139
|
-
assert.ok(
|
|
1140
|
-
instance instanceof FooComponent,
|
|
1141
|
-
'an instance of FooComponent has been created'
|
|
1142
|
-
);
|
|
1168
|
+
assert.ok(instance instanceof Foo, 'an instance of Foo has been created');
|
|
1143
1169
|
|
|
1144
1170
|
let { details, errors } = await inspectObject(instance);
|
|
1145
1171
|
|
|
@@ -1159,13 +1185,19 @@ module('Ember Debug - Object Inspector', function (hooks) {
|
|
|
1159
1185
|
assert.ok(properties.indexOf('bar') > -1, 'contains bar');
|
|
1160
1186
|
assert.ok(properties.indexOf('baz') > -1, 'contains baz');
|
|
1161
1187
|
|
|
1162
|
-
assert.
|
|
1163
|
-
|
|
1164
|
-
|
|
1188
|
+
assert.strictEqual(
|
|
1189
|
+
properties.indexOf('bounds'),
|
|
1190
|
+
-1,
|
|
1191
|
+
'does not contain bounds'
|
|
1192
|
+
);
|
|
1193
|
+
assert.strictEqual(
|
|
1194
|
+
properties.indexOf('element'),
|
|
1195
|
+
-1,
|
|
1165
1196
|
'does not contain element'
|
|
1166
1197
|
);
|
|
1167
|
-
assert.
|
|
1168
|
-
properties.indexOf('debugName')
|
|
1198
|
+
assert.strictEqual(
|
|
1199
|
+
properties.indexOf('debugName'),
|
|
1200
|
+
-1,
|
|
1169
1201
|
'does not contain debugName'
|
|
1170
1202
|
);
|
|
1171
1203
|
});
|