ember-inspector 4.13.1-alpha.2024.8.9 → 4.13.1-alpha.2025.6.8
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/README.md +10 -2
- package/app/components/app-picker.hbs +2 -2
- package/app/components/component-tree-item.hbs +13 -13
- package/app/components/component-tree-toolbar.hbs +3 -3
- package/app/components/{date-property-field.js → date-property-field.ts} +6 -5
- package/app/components/deprecation-item-source.hbs +1 -1
- package/app/components/deprecation-item.hbs +1 -1
- package/app/components/deprecations-toolbar.hbs +1 -1
- package/app/components/item-types.hbs +7 -7
- package/app/components/list-cell.hbs +3 -3
- package/app/components/list-content.hbs +4 -3
- package/app/components/list-content.ts +96 -0
- package/app/components/list.hbs +3 -3
- package/app/components/list.js +7 -7
- package/app/components/model-types-toolbar.hbs +3 -3
- package/app/components/object-inspector/dependent-keys.hbs +4 -4
- package/app/components/object-inspector/errors.hbs +4 -4
- package/app/components/object-inspector/properties-all.hbs +1 -1
- package/app/components/object-inspector/properties-grouped.hbs +5 -5
- package/app/components/object-inspector/property.hbs +16 -16
- package/app/components/object-inspector/property.ts +26 -17
- package/app/components/object-inspector/sort-properties.js +12 -4
- package/app/components/object-inspector.hbs +8 -8
- package/app/components/object-inspector.js +1 -1
- package/app/components/promise-item.hbs +11 -11
- package/app/components/promise-item.js +8 -6
- package/app/components/promise-tree-toolbar.hbs +5 -5
- package/app/components/records-toolbar.hbs +2 -2
- package/app/components/render-item.hbs +4 -4
- package/app/components/render-item.ts +12 -9
- package/app/components/render-tree-toolbar.hbs +1 -1
- package/app/components/route-cell-name.hbs +1 -1
- package/app/components/route-cell-name.js +3 -2
- package/app/components/route-tree-toolbar.hbs +2 -2
- package/app/components/scroll-container.js +2 -0
- package/app/components/side-nav.hbs +5 -5
- package/app/components/side-nav.js +1 -1
- package/app/computed/{debounce.js → debounce.ts} +7 -5
- package/app/config/environment.d.ts +5 -2
- package/app/controllers/app-config.js +1 -0
- package/app/controllers/application.js +33 -34
- package/app/controllers/component-tree.js +3 -2
- package/app/controllers/container-type.js +2 -1
- package/app/controllers/container-types/{index.js → index.ts} +5 -2
- package/app/controllers/container-types.js +3 -6
- package/app/controllers/deprecations.js +16 -11
- package/app/controllers/libraries.js +1 -0
- package/app/controllers/model-types.js +1 -0
- package/app/controllers/promise-tree.ts +149 -0
- package/app/controllers/records.js +18 -26
- package/app/controllers/{render-tree.js → render-tree.ts} +54 -45
- package/app/controllers/route-tree.js +7 -5
- package/app/helpers/build-style.js +1 -1
- package/app/initializers/setup.js +1 -1
- package/app/libs/promise-assembler.ts +249 -0
- package/app/libs/resizable-columns.js +10 -10
- package/app/models/{promise.js → promise.ts} +72 -69
- package/app/{router.js → router.ts} +1 -1
- package/app/routes/app-detected.js +3 -5
- package/app/routes/application.js +6 -12
- package/app/routes/deprecations.js +7 -16
- package/app/routes/launch.js +2 -1
- package/app/routes/libraries.js +2 -1
- package/app/routes/model-type.js +2 -3
- package/app/routes/model-types.ts +57 -0
- package/app/routes/promise-tree.ts +63 -0
- package/app/routes/records.ts +78 -0
- package/app/routes/render-tree.ts +93 -0
- package/app/routes/route-tree.js +0 -1
- package/app/routes/{tab.js → tab.ts} +9 -2
- package/app/routes/whats-new.js +1 -1
- package/app/services/adapters/{basic.js → basic.ts} +36 -30
- package/app/services/adapters/{bookmarklet.js → bookmarklet.ts} +17 -24
- package/app/services/adapters/{chrome.js → chrome.ts} +1 -2
- package/app/services/adapters/{web-extension.js → web-extension.ts} +43 -46
- package/app/services/adapters/websocket.ts +40 -0
- package/app/services/layout.ts +88 -0
- package/app/services/port.ts +195 -0
- package/app/services/storage/{local.js → local.ts} +7 -20
- package/app/services/storage/{memory.js → memory.ts} +6 -21
- package/app/services/{storage.js → storage.ts} +9 -20
- package/app/styles/base.scss +4 -2
- package/app/styles/colors.scss +33 -31
- package/app/styles/component_tree.scss +56 -51
- package/app/styles/dropdown.scss +2 -2
- package/app/styles/ember-table.scss +3 -3
- package/app/styles/mixin.scss +26 -26
- package/app/styles/object_inspector.scss +22 -21
- package/app/styles/utils.scss +408 -122
- package/app/templates/application.hbs +11 -11
- package/app/templates/component-tree.hbs +1 -1
- package/app/templates/deprecations.hbs +2 -3
- package/app/templates/info.hbs +10 -10
- package/app/templates/promise-tree.hbs +1 -1
- package/app/templates/render-tree.hbs +1 -1
- package/app/templates/route-tree.hbs +1 -1
- package/app/utils/escape-reg-exp.ts +3 -2
- package/app/utils/nullish.ts +7 -0
- package/app/utils/parse-text.ts +4 -5
- package/app/utils/truncate.js +0 -1
- package/config/ember-cli-update.json +5 -3
- package/config/ember-try.js +117 -72
- package/config/environment.js +1 -1
- package/config/optional-features.json +2 -1
- package/dist/bookmarklet/load_inspector.js +30 -11
- package/dist/bookmarklet/panes-3-16-0/assets/chunk.443.86a005e528b587663b78.js +1135 -0
- package/dist/bookmarklet/panes-3-16-0/assets/chunk.443.86a005e528b587663b78.js.LICENSE.txt +18 -0
- package/dist/bookmarklet/panes-3-16-0/assets/chunk.524.c8707b06d2f496a0d15d.js +40 -0
- package/dist/bookmarklet/panes-3-16-0/assets/chunk.582.6d68f76dc5c8ba2b48a8.js +42 -0
- package/dist/bookmarklet/panes-3-16-0/assets/ember-inspector.css +150 -155
- package/dist/bookmarklet/panes-3-16-0/assets/ember-inspector.js +486 -590
- package/dist/bookmarklet/panes-3-16-0/assets/svg/ellipsis.svg +3 -3
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-bug.svg +1 -1
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-components.svg +2 -2
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-container.svg +1 -1
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-data.svg +1 -1
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-deprecations.svg +3 -3
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-info.svg +3 -3
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-promises.svg +2 -2
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-render-performance.svg +2 -2
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-route-tree.svg +7 -7
- package/dist/bookmarklet/panes-3-16-0/assets/vendor.css +147 -148
- package/dist/bookmarklet/panes-3-16-0/assets/vendor.js +5153 -5980
- package/dist/bookmarklet/panes-3-16-0/ember_debug.js +250 -268
- package/dist/bookmarklet/panes-3-16-0/index.html +3 -4
- package/dist/chrome/background.js +26 -21
- package/dist/chrome/boot.js +1 -1
- package/dist/chrome/content-script.js +11 -11
- package/dist/chrome/devtools.js +12 -3
- package/dist/chrome/manifest.json +2 -2
- package/dist/chrome/options.js +17 -12
- package/dist/chrome/panes-3-16-0/assets/chunk.443.86a005e528b587663b78.js +1135 -0
- package/dist/chrome/panes-3-16-0/assets/chunk.443.86a005e528b587663b78.js.LICENSE.txt +18 -0
- package/dist/chrome/panes-3-16-0/assets/chunk.524.c8707b06d2f496a0d15d.js +40 -0
- package/dist/chrome/panes-3-16-0/assets/chunk.582.6d68f76dc5c8ba2b48a8.js +42 -0
- package/dist/chrome/panes-3-16-0/assets/ember-inspector.css +150 -155
- package/dist/chrome/panes-3-16-0/assets/ember-inspector.js +486 -590
- package/dist/chrome/panes-3-16-0/assets/svg/ellipsis.svg +3 -3
- package/dist/chrome/panes-3-16-0/assets/svg/nav-bug.svg +1 -1
- package/dist/chrome/panes-3-16-0/assets/svg/nav-components.svg +2 -2
- package/dist/chrome/panes-3-16-0/assets/svg/nav-container.svg +1 -1
- package/dist/chrome/panes-3-16-0/assets/svg/nav-data.svg +1 -1
- package/dist/chrome/panes-3-16-0/assets/svg/nav-deprecations.svg +3 -3
- package/dist/chrome/panes-3-16-0/assets/svg/nav-info.svg +3 -3
- package/dist/chrome/panes-3-16-0/assets/svg/nav-promises.svg +2 -2
- package/dist/chrome/panes-3-16-0/assets/svg/nav-render-performance.svg +2 -2
- package/dist/chrome/panes-3-16-0/assets/svg/nav-route-tree.svg +7 -7
- package/dist/chrome/panes-3-16-0/assets/vendor.css +147 -148
- package/dist/chrome/panes-3-16-0/assets/vendor.js +5153 -5980
- package/dist/chrome/panes-3-16-0/ember_debug.js +250 -268
- package/dist/chrome/panes-3-16-0/index.html +3 -4
- package/dist/chrome/scripts/in-page-script.js +19 -13
- package/dist/firefox/background.js +26 -21
- package/dist/firefox/boot.js +1 -1
- package/dist/firefox/content-script.js +11 -11
- package/dist/firefox/devtools.js +12 -3
- package/dist/firefox/manifest.json +2 -2
- package/dist/firefox/options.js +17 -12
- package/dist/firefox/panes-3-16-0/assets/chunk.443.86a005e528b587663b78.js +1135 -0
- package/dist/firefox/panes-3-16-0/assets/chunk.443.86a005e528b587663b78.js.LICENSE.txt +18 -0
- package/dist/firefox/panes-3-16-0/assets/chunk.524.c8707b06d2f496a0d15d.js +40 -0
- package/dist/firefox/panes-3-16-0/assets/chunk.582.6d68f76dc5c8ba2b48a8.js +42 -0
- package/dist/firefox/panes-3-16-0/assets/ember-inspector.css +150 -155
- package/dist/firefox/panes-3-16-0/assets/ember-inspector.js +486 -590
- package/dist/firefox/panes-3-16-0/assets/svg/ellipsis.svg +3 -3
- package/dist/firefox/panes-3-16-0/assets/svg/nav-bug.svg +1 -1
- package/dist/firefox/panes-3-16-0/assets/svg/nav-components.svg +2 -2
- package/dist/firefox/panes-3-16-0/assets/svg/nav-container.svg +1 -1
- package/dist/firefox/panes-3-16-0/assets/svg/nav-data.svg +1 -1
- package/dist/firefox/panes-3-16-0/assets/svg/nav-deprecations.svg +3 -3
- package/dist/firefox/panes-3-16-0/assets/svg/nav-info.svg +3 -3
- package/dist/firefox/panes-3-16-0/assets/svg/nav-promises.svg +2 -2
- package/dist/firefox/panes-3-16-0/assets/svg/nav-render-performance.svg +2 -2
- package/dist/firefox/panes-3-16-0/assets/svg/nav-route-tree.svg +7 -7
- package/dist/firefox/panes-3-16-0/assets/vendor.css +147 -148
- package/dist/firefox/panes-3-16-0/assets/vendor.js +5153 -5980
- package/dist/firefox/panes-3-16-0/ember_debug.js +250 -268
- package/dist/firefox/panes-3-16-0/index.html +3 -4
- package/dist/firefox/scripts/in-page-script.js +19 -13
- package/dist/websocket/assets/chunk.443.86a005e528b587663b78.js +1135 -0
- package/dist/websocket/assets/chunk.443.86a005e528b587663b78.js.LICENSE.txt +18 -0
- package/dist/websocket/assets/chunk.524.c8707b06d2f496a0d15d.js +40 -0
- package/dist/websocket/assets/chunk.582.6d68f76dc5c8ba2b48a8.js +42 -0
- package/dist/websocket/assets/ember-inspector.css +150 -155
- package/dist/websocket/assets/ember-inspector.js +486 -590
- package/dist/websocket/assets/svg/ellipsis.svg +3 -3
- package/dist/websocket/assets/svg/nav-bug.svg +1 -1
- package/dist/websocket/assets/svg/nav-components.svg +2 -2
- package/dist/websocket/assets/svg/nav-container.svg +1 -1
- package/dist/websocket/assets/svg/nav-data.svg +1 -1
- package/dist/websocket/assets/svg/nav-deprecations.svg +3 -3
- package/dist/websocket/assets/svg/nav-info.svg +3 -3
- package/dist/websocket/assets/svg/nav-promises.svg +2 -2
- package/dist/websocket/assets/svg/nav-render-performance.svg +2 -2
- package/dist/websocket/assets/svg/nav-route-tree.svg +7 -7
- package/dist/websocket/assets/vendor.css +147 -148
- package/dist/websocket/assets/vendor.js +5153 -5980
- package/dist/websocket/ember_debug.js +250 -268
- package/dist/websocket/index.html +3 -4
- package/ember-cli-build.js +11 -11
- package/ember_debug/adapters/basic.js +2 -1
- package/ember_debug/adapters/bookmarklet.js +1 -0
- package/ember_debug/adapters/firefox.js +3 -3
- package/ember_debug/adapters/web-extension.js +2 -1
- package/ember_debug/data-debug.js +5 -6
- package/ember_debug/deprecation-debug.js +8 -8
- package/ember_debug/general-debug.js +1 -1
- package/ember_debug/libs/capture-render-tree.js +0 -1
- package/ember_debug/libs/promise-assembler.js +1 -0
- package/ember_debug/libs/render-tree.js +13 -12
- package/ember_debug/libs/source-map.js +5 -4
- package/ember_debug/libs/view-inspection.js +12 -12
- package/ember_debug/main.js +1 -1
- package/ember_debug/models/profile-manager.js +2 -1
- package/ember_debug/object-inspector.js +19 -18
- package/ember_debug/port.js +1 -0
- package/ember_debug/promise-debug.js +1 -1
- package/ember_debug/route-debug.js +3 -2
- package/ember_debug/services/session.js +1 -1
- package/ember_debug/utils/classify.js +1 -1
- package/ember_debug/utils/ember/debug.js +2 -0
- package/ember_debug/utils/ember/loader.js +2 -2
- package/ember_debug/utils/ember/runloop.js +2 -0
- package/ember_debug/utils/ember-object-names.js +2 -2
- package/ember_debug/utils/ember.js +9 -3
- package/ember_debug/utils/evented.js +1 -1
- package/ember_debug/utils/get-object-name.js +2 -2
- package/ember_debug/utils/rsvp.js +1 -0
- package/ember_debug/utils/type-check.js +5 -1
- package/ember_debug/vendor/startup-wrapper.js +4 -1
- package/ember_debug/view-debug.js +3 -2
- package/eslint.config.mjs +172 -0
- package/gulpfile.js +1 -1
- package/lib/ui/addon/components/drag-handle.hbs +4 -4
- package/lib/ui/addon/components/drag-handle.js +3 -1
- package/lib/ui/addon/components/empty-message.hbs +1 -1
- package/lib/ui/addon/components/error-page.hbs +3 -3
- package/lib/ui/addon/components/resizable-column.js +1 -1
- package/lib/ui/addon/components/toolbar-clear-button.hbs +1 -1
- package/lib/ui/addon/components/toolbar-reload-button.hbs +1 -1
- package/lib/ui/addon/components/toolbar-search-field.hbs +2 -2
- package/lib/ui/addon/styles/_disclosure-triangle.scss +3 -1
- package/lib/ui/addon/styles/_drag-handle.scss +7 -7
- package/lib/ui/addon/styles/_empty-message.scss +1 -1
- package/lib/ui/addon/styles/_error-page.scss +8 -7
- package/lib/ui/addon/styles/_list.scss +46 -45
- package/lib/ui/addon/styles/_nav.scss +29 -27
- package/lib/ui/addon/styles/_object-inspector-toggle.scss +5 -5
- package/lib/ui/addon/styles/_pill.scss +4 -4
- package/lib/ui/addon/styles/_send-to-console.scss +1 -1
- package/lib/ui/addon/styles/_split.scss +17 -20
- package/lib/ui/addon/styles/addon.scss +13 -13
- package/lib/ui/addon/styles/toolbar/_checkbox.scss +5 -5
- package/lib/ui/addon/styles/toolbar/_icon-button.scss +44 -25
- package/lib/ui/addon/styles/toolbar/_index.scss +6 -5
- package/lib/ui/addon/styles/toolbar/_radio.scss +10 -10
- package/lib/ui/addon/styles/toolbar/_search.scss +5 -3
- package/package.json +85 -86
- package/public/assets/svg/ellipsis.svg +3 -3
- package/public/assets/svg/nav-bug.svg +1 -1
- package/public/assets/svg/nav-components.svg +2 -2
- package/public/assets/svg/nav-container.svg +1 -1
- package/public/assets/svg/nav-data.svg +1 -1
- package/public/assets/svg/nav-deprecations.svg +3 -3
- package/public/assets/svg/nav-info.svg +3 -3
- package/public/assets/svg/nav-promises.svg +2 -2
- package/public/assets/svg/nav-render-performance.svg +2 -2
- package/public/assets/svg/nav-route-tree.svg +7 -7
- package/scripts/download-panes.js +1 -1
- package/skeletons/bookmarklet/load_inspector.js +30 -11
- package/skeletons/web-extension/background.js +26 -21
- package/skeletons/web-extension/boot.js +1 -1
- package/skeletons/web-extension/content-script.js +11 -11
- package/skeletons/web-extension/devtools.js +12 -3
- package/skeletons/web-extension/manifest.json +2 -2
- package/skeletons/web-extension/options.js +17 -12
- package/skeletons/web-extension/scripts/in-page-script.js +19 -13
- package/testem.js +0 -1
- package/tests/acceptance/app-picker-test.js +4 -4
- package/tests/acceptance/component-tree-test.js +43 -57
- package/tests/acceptance/container-test.js +0 -2
- package/tests/acceptance/data-test.js +8 -10
- package/tests/acceptance/deprecation-test.js +8 -12
- package/tests/acceptance/info-test.js +2 -2
- package/tests/acceptance/object-inspector-test.js +62 -110
- package/tests/acceptance/promise-test.js +1 -11
- package/tests/acceptance/render-tree-test.js +2 -2
- package/tests/acceptance/route-tree-test.js +12 -14
- package/tests/acceptance/whats-new-test.js +3 -3
- package/tests/ember_debug/container-debug-test.js +4 -4
- package/tests/ember_debug/deprecation-debug-test.js +8 -5
- package/tests/ember_debug/ember-debug-test.js +1 -4
- package/tests/ember_debug/object-inspector-test.js +44 -44
- package/tests/ember_debug/profile-manager-test.js +140 -165
- package/tests/ember_debug/profile-node-test.js +3 -3
- package/tests/ember_debug/promise-assembler-test.js +12 -9
- package/tests/ember_debug/promise-debug-test.js +5 -6
- package/tests/ember_debug/route-debug-test.js +8 -7
- package/tests/ember_debug/view-debug-test.js +179 -181
- package/tests/helpers/{index.js → index.ts} +6 -5
- package/tests/helpers/setup-ember-debug-test.js +14 -0
- package/tests/integration/injection-test.js +12 -13
- package/tests/test-adapter.js +15 -15
- package/tests/test-helper.js +6 -1
- package/tests/unit/check-current-route-test.js +0 -4
- package/tests/unit/resizable-columns-test.js +53 -51
- package/tests/unit/utils/parse-text-test.js +3 -3
- package/tests/unit/utils/search-match-test.js +5 -5
- package/tests/unit/utils/type-check-test.js +22 -0
- package/tsconfig.json +3 -1
- package/types/ember-inspector/index.d.ts +2 -1
- package/types/global.d.ts +1 -7
- package/.editorconfig +0 -19
- package/.ember-cli +0 -15
- package/.eslintignore +0 -33
- package/.eslintrc.js +0 -86
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -30
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/.github/dependabot.yml +0 -14
- package/.github/pull_request_template.md +0 -4
- package/.github/workflows/build.yml +0 -339
- package/.github/workflows/plan-release.yml +0 -83
- package/.github/workflows/publish.yml +0 -60
- package/.prettierignore +0 -25
- package/.prettierrc.js +0 -14
- package/.release-plan.json +0 -17
- package/.stylelintrc.js +0 -3
- package/.template-lintrc.js +0 -12
- package/.tool-versions +0 -2
- package/.watchmanconfig +0 -3
- package/app/components/.gitkeep +0 -0
- package/app/components/list-content.js +0 -130
- package/app/controllers/.gitkeep +0 -0
- package/app/controllers/promise-tree.js +0 -130
- package/app/helpers/.gitkeep +0 -0
- package/app/libs/promise-assembler.js +0 -169
- package/app/models/.gitkeep +0 -0
- package/app/routes/.gitkeep +0 -0
- package/app/routes/model-types.js +0 -47
- package/app/routes/promise-tree.js +0 -48
- package/app/routes/records.js +0 -55
- package/app/routes/render-tree.js +0 -66
- package/app/services/adapters/websocket.js +0 -31
- package/app/services/layout.js +0 -39
- package/app/services/port.js +0 -90
- package/dist/bookmarklet/panes-3-16-0/assets/chunk.143.143ca772b0b28102c74a.js +0 -28
- package/dist/bookmarklet/panes-3-16-0/assets/chunk.178.b50e140d1ed8777b583e.js +0 -9
- package/dist/bookmarklet/panes-3-16-0/assets/chunk.359.0be5d21f60d2b5d6d423.js +0 -2620
- package/dist/bookmarklet/panes-3-16-0/assets/chunk.359.0be5d21f60d2b5d6d423.js.LICENSE.txt +0 -67
- package/dist/chrome/panes-3-16-0/assets/chunk.143.143ca772b0b28102c74a.js +0 -28
- package/dist/chrome/panes-3-16-0/assets/chunk.178.b50e140d1ed8777b583e.js +0 -9
- package/dist/chrome/panes-3-16-0/assets/chunk.359.0be5d21f60d2b5d6d423.js +0 -2620
- package/dist/chrome/panes-3-16-0/assets/chunk.359.0be5d21f60d2b5d6d423.js.LICENSE.txt +0 -67
- package/dist/firefox/panes-3-16-0/assets/chunk.143.143ca772b0b28102c74a.js +0 -28
- package/dist/firefox/panes-3-16-0/assets/chunk.178.b50e140d1ed8777b583e.js +0 -9
- package/dist/firefox/panes-3-16-0/assets/chunk.359.0be5d21f60d2b5d6d423.js +0 -2620
- package/dist/firefox/panes-3-16-0/assets/chunk.359.0be5d21f60d2b5d6d423.js.LICENSE.txt +0 -67
- package/dist/websocket/assets/chunk.143.143ca772b0b28102c74a.js +0 -28
- package/dist/websocket/assets/chunk.178.b50e140d1ed8777b583e.js +0 -9
- package/dist/websocket/assets/chunk.359.0be5d21f60d2b5d6d423.js +0 -2620
- package/dist/websocket/assets/chunk.359.0be5d21f60d2b5d6d423.js.LICENSE.txt +0 -67
- package/ember_debug/.eslintrc.js +0 -13
- package/tests/helpers/trigger-port.js +0 -6
- package/tests/unit/.gitkeep +0 -0
- /package/app/{app.js → app.ts} +0 -0
- /package/app/controllers/{info.js → info.ts} +0 -0
- /package/app/services/adapters/{firefox.js → firefox.ts} +0 -0
@@ -1,4 +1,6 @@
|
|
1
|
+
/* eslint-disable ember/no-classic-classes */
|
1
2
|
import { find, visit, waitUntil, getSettledState } from '@ember/test-helpers';
|
3
|
+
// eslint-disable-next-line ember/no-classic-components
|
2
4
|
import EmberComponent from '@ember/component';
|
3
5
|
import GlimmerComponent from '@glimmer/component';
|
4
6
|
import EmberRoute from '@ember/routing/route';
|
@@ -10,6 +12,7 @@ import setupEmberDebugTest from '../helpers/setup-ember-debug-test';
|
|
10
12
|
import { run } from '@ember/runloop';
|
11
13
|
import Ember from 'ember-debug/utils/ember';
|
12
14
|
import { compareVersion } from 'ember-debug/utils/version';
|
15
|
+
import { setComponentTemplate } from '@ember/component';
|
13
16
|
|
14
17
|
const { VERSION } = Ember;
|
15
18
|
|
@@ -26,119 +29,123 @@ const getRounded = (value) => {
|
|
26
29
|
}
|
27
30
|
return Math.floor(data);
|
28
31
|
};
|
29
|
-
class OneRootGlimmer extends GlimmerComponent {
|
30
|
-
classNames = 'simple-component';
|
31
|
-
}
|
32
32
|
|
33
|
-
const mockedComponents = {
|
34
|
-
|
35
|
-
component
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
}
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
}
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
}
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
}
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
33
|
+
const mockedComponents = () => {
|
34
|
+
class OneRootGlimmer extends GlimmerComponent {
|
35
|
+
classNames = 'simple-component';
|
36
|
+
}
|
37
|
+
|
38
|
+
return {
|
39
|
+
text: {
|
40
|
+
component: EmberComponent.extend({
|
41
|
+
tagName: '',
|
42
|
+
}),
|
43
|
+
template: hbs('text only', {
|
44
|
+
moduleName: 'my-app/templates/components/text.hbs',
|
45
|
+
}),
|
46
|
+
},
|
47
|
+
'text-glimmer': {
|
48
|
+
component: class extends GlimmerComponent {},
|
49
|
+
template: hbs('text only', {
|
50
|
+
moduleName: 'my-app/templates/components/text-glimmer.hbs',
|
51
|
+
}),
|
52
|
+
},
|
53
|
+
comment: {
|
54
|
+
component: EmberComponent.extend({
|
55
|
+
tagName: '',
|
56
|
+
}),
|
57
|
+
template: hbs('<!-- comment -->', {
|
58
|
+
moduleName: 'my-app/templates/components/comment.hbs',
|
59
|
+
}),
|
60
|
+
},
|
61
|
+
'comment-glimmer': {
|
62
|
+
component: class extends GlimmerComponent {},
|
63
|
+
template: hbs('<!-- comment -->', {
|
64
|
+
moduleName: 'my-app/templates/components/comment-glimmer.hbs',
|
65
|
+
}),
|
66
|
+
},
|
67
|
+
'one-root': {
|
68
|
+
component: EmberComponent.extend({
|
69
|
+
tagName: '',
|
70
|
+
}),
|
71
|
+
template: hbs('<div class="simple-component">one root</div>', {
|
72
|
+
moduleName: 'my-app/templates/components/one-root.hbs',
|
73
|
+
}),
|
74
|
+
},
|
75
|
+
'one-root-glimmer': {
|
76
|
+
component: OneRootGlimmer,
|
77
|
+
template: hbs('<div class={{this.classNames}}>one root</div>', {
|
78
|
+
moduleName: 'my-app/templates/components/one-root-glimmer.hbs',
|
79
|
+
}),
|
80
|
+
},
|
81
|
+
'two-root': {
|
82
|
+
component: EmberComponent.extend({
|
83
|
+
tagName: '',
|
84
|
+
}),
|
85
|
+
template: hbs(
|
86
|
+
'<div class="simple-component">one</div><div class="another-component">two</div>',
|
87
|
+
{ moduleName: 'my-app/templates/components/two-root.hbs' },
|
88
|
+
),
|
89
|
+
},
|
90
|
+
'two-root-glimmer': {
|
91
|
+
component: class extends GlimmerComponent {},
|
92
|
+
template: hbs(
|
93
|
+
'<div class="simple-component">one</div><div class="another-component">two</div>',
|
94
|
+
{ moduleName: 'my-app/templates/components/two-root-glimmer.hbs' },
|
95
|
+
),
|
96
|
+
},
|
97
|
+
'root-comment-root': {
|
98
|
+
component: EmberComponent.extend({
|
99
|
+
tagName: '',
|
100
|
+
}),
|
101
|
+
template: hbs(
|
102
|
+
'<div class="simple-component">one</div><!-- comment --><div class="another-component">two</div>',
|
103
|
+
{ moduleName: 'my-app/templates/components/root-comment-root.hbs' },
|
104
|
+
),
|
105
|
+
},
|
106
|
+
'root-comment-root-glimmer': {
|
107
|
+
component: class extends GlimmerComponent {},
|
108
|
+
template: hbs(
|
109
|
+
'<div class="simple-component">one</div><!-- comment --><div class="another-component">two</div>',
|
110
|
+
{
|
111
|
+
moduleName:
|
112
|
+
'my-app/templates/components/root-comment-root-glimmer.hbs',
|
113
|
+
},
|
114
|
+
),
|
115
|
+
},
|
116
|
+
'comment-root-comment': {
|
117
|
+
component: EmberComponent.extend({
|
118
|
+
tagName: '',
|
119
|
+
}),
|
120
|
+
template: hbs(
|
121
|
+
'<!-- comment 1 --><div class="simple-component">one</div><!-- comment 2 -->',
|
122
|
+
{ moduleName: 'my-app/templates/components/comment-root-comment.hbs' },
|
123
|
+
),
|
124
|
+
},
|
125
|
+
'comment-root-comment-glimmer': {
|
126
|
+
component: class extends GlimmerComponent {},
|
127
|
+
template: hbs(
|
128
|
+
'<!-- comment 1 --><div class="simple-component">one</div><!-- comment 2 -->',
|
129
|
+
{ moduleName: 'my-app/templates/components/comment-root-comment.hbs' },
|
130
|
+
),
|
131
|
+
},
|
132
|
+
'div-tag': {
|
133
|
+
component: EmberComponent.extend({
|
134
|
+
classNames: ['simple-component'],
|
135
|
+
}),
|
136
|
+
template: hbs('text in div', {
|
137
|
+
moduleName: 'my-app/templates/components/div-tag.hbs',
|
138
|
+
}),
|
139
|
+
},
|
140
|
+
'div-roots': {
|
141
|
+
component: EmberComponent.extend({
|
142
|
+
classNames: ['simple-component'],
|
143
|
+
}),
|
144
|
+
template: hbs('<div>one</div><div>two</div>', {
|
145
|
+
moduleName: 'my-app/templates/components/div-roots.hbs',
|
146
|
+
}),
|
147
|
+
},
|
148
|
+
};
|
142
149
|
};
|
143
150
|
|
144
151
|
const mockedRoutes = {
|
@@ -237,32 +244,27 @@ const constructBase = (owner) => {
|
|
237
244
|
'template:application',
|
238
245
|
hbs(
|
239
246
|
'<div class="application" style="line-height: normal;">{{outlet}}</div>',
|
240
|
-
{ moduleName: 'my-app/templates/application.hbs' }
|
241
|
-
)
|
247
|
+
{ moduleName: 'my-app/templates/application.hbs' },
|
248
|
+
),
|
242
249
|
);
|
243
250
|
|
244
251
|
owner.register('route:home', EmberRoute);
|
245
252
|
|
246
253
|
owner.register(
|
247
254
|
'template:home',
|
248
|
-
hbs('Home', { moduleName: 'my-app/templates/home.hbs' })
|
255
|
+
hbs('Home', { moduleName: 'my-app/templates/home.hbs' }),
|
249
256
|
);
|
250
257
|
};
|
251
258
|
|
252
259
|
const constructComponents = (owner, componentsMap) => {
|
253
260
|
for (const componentKey in componentsMap) {
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
componentsMap[componentKey].
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
owner.register(
|
262
|
-
`template:components/${componentKey}`,
|
263
|
-
componentsMap[componentKey].template
|
264
|
-
);
|
265
|
-
}
|
261
|
+
owner.register(
|
262
|
+
`component:${componentKey}`,
|
263
|
+
setComponentTemplate(
|
264
|
+
componentsMap[componentKey].template,
|
265
|
+
componentsMap[componentKey].component,
|
266
|
+
),
|
267
|
+
);
|
266
268
|
}
|
267
269
|
};
|
268
270
|
|
@@ -274,7 +276,7 @@ const constructRoutes = (owner, routes) => {
|
|
274
276
|
if (mockedRoutes[routeKey].controller) {
|
275
277
|
owner.register(
|
276
278
|
`controller:${routeKey}`,
|
277
|
-
mockedRoutes[routeKey].controller
|
279
|
+
mockedRoutes[routeKey].controller,
|
278
280
|
);
|
279
281
|
}
|
280
282
|
if (mockedRoutes[routeKey].template) {
|
@@ -296,7 +298,7 @@ const assertNodeSizes = (assert, synthetic, real) => {
|
|
296
298
|
assert.strictEqual(
|
297
299
|
getRounded(style[styleKey]),
|
298
300
|
getRounded(box[boxKey]),
|
299
|
-
`same ${boxKey} as component
|
301
|
+
`same ${boxKey} as component`,
|
300
302
|
);
|
301
303
|
}
|
302
304
|
};
|
@@ -305,7 +307,7 @@ const matchHighlights = (
|
|
305
307
|
assert,
|
306
308
|
testedRoute,
|
307
309
|
newHighlights,
|
308
|
-
isGlimmerComponent
|
310
|
+
isGlimmerComponent,
|
309
311
|
) => {
|
310
312
|
const renderedComponents = mockedRoutes[testedRoute].expectedRender.map(
|
311
313
|
(selector) => {
|
@@ -314,10 +316,10 @@ const matchHighlights = (
|
|
314
316
|
component,
|
315
317
|
isComponentHighlightSupported
|
316
318
|
? 'expected component is rendered'
|
317
|
-
: 'expected component is rendered but the component highlight is not supported'
|
319
|
+
: 'expected component is rendered but the component highlight is not supported',
|
318
320
|
);
|
319
321
|
return component;
|
320
|
-
}
|
322
|
+
},
|
321
323
|
);
|
322
324
|
|
323
325
|
if (isComponentHighlightSupported && !isGlimmerComponent) {
|
@@ -327,16 +329,17 @@ const matchHighlights = (
|
|
327
329
|
} else {
|
328
330
|
assert.notOk(
|
329
331
|
newHighlights.length,
|
330
|
-
'Should not have any highlight if highlight is not supported'
|
332
|
+
'Should not have any highlight if highlight is not supported',
|
331
333
|
);
|
332
334
|
}
|
333
335
|
};
|
334
336
|
|
335
337
|
const enableHighlight = () => {
|
338
|
+
// eslint-disable-next-line ember/no-runloop
|
336
339
|
run(() =>
|
337
340
|
EmberDebug.port.trigger('render:updateShouldHighlightRender', {
|
338
341
|
shouldHighlightRender: true,
|
339
|
-
})
|
342
|
+
}),
|
340
343
|
);
|
341
344
|
};
|
342
345
|
|
@@ -395,23 +398,21 @@ module('Ember Debug - profile manager component highlight', function (hooks) {
|
|
395
398
|
hooks.beforeEach(async function () {
|
396
399
|
EmberDebug.IGNORE_DEPRECATIONS = true;
|
397
400
|
constructBase(this.owner);
|
398
|
-
constructComponents(this.owner, mockedComponents);
|
401
|
+
constructComponents(this.owner, mockedComponents());
|
399
402
|
});
|
400
403
|
|
401
404
|
hooks.afterEach(function (assert) {
|
402
405
|
const highlights = document.getElementsByClassName(
|
403
|
-
'ember-inspector-render-highlight'
|
406
|
+
'ember-inspector-render-highlight',
|
404
407
|
);
|
405
408
|
|
406
409
|
assert.notOk(
|
407
410
|
highlights?.length,
|
408
|
-
'highlights should be destroyed after execution'
|
411
|
+
'highlights should be destroyed after execution',
|
409
412
|
);
|
410
413
|
});
|
411
414
|
|
412
415
|
test('Should not show highlights for text component - Ember component', async function (assert) {
|
413
|
-
assert.expect(2);
|
414
|
-
|
415
416
|
const testedRoute = 'text-route';
|
416
417
|
constructRoutes(this.owner, [testedRoute]);
|
417
418
|
|
@@ -421,8 +422,6 @@ module('Ember Debug - profile manager component highlight', function (hooks) {
|
|
421
422
|
});
|
422
423
|
|
423
424
|
test('Should not show highlights for text component - Glimmer component', async function (assert) {
|
424
|
-
assert.expect(2);
|
425
|
-
|
426
425
|
const testedRoute = 'text-glimmer-route';
|
427
426
|
constructRoutes(this.owner, [testedRoute]);
|
428
427
|
|
@@ -432,8 +431,6 @@ module('Ember Debug - profile manager component highlight', function (hooks) {
|
|
432
431
|
});
|
433
432
|
|
434
433
|
test('Should not show highlights for comment component - Ember component', async function (assert) {
|
435
|
-
assert.expect(2);
|
436
|
-
|
437
434
|
const testedRoute = 'comment-route';
|
438
435
|
constructRoutes(this.owner, [testedRoute]);
|
439
436
|
|
@@ -443,8 +440,6 @@ module('Ember Debug - profile manager component highlight', function (hooks) {
|
|
443
440
|
});
|
444
441
|
|
445
442
|
test('Should not show highlights for comment component - Glimmer component', async function (assert) {
|
446
|
-
assert.expect(2);
|
447
|
-
|
448
443
|
const testedRoute = 'comment-glimmer-route';
|
449
444
|
constructRoutes(this.owner, [testedRoute]);
|
450
445
|
|
@@ -454,8 +449,6 @@ module('Ember Debug - profile manager component highlight', function (hooks) {
|
|
454
449
|
});
|
455
450
|
|
456
451
|
test('Should highlight one rootNode Ember component', async function (assert) {
|
457
|
-
assert.expect(isComponentHighlightSupported ? 6 : 3);
|
458
|
-
|
459
452
|
const testedRoute = 'one-root-route';
|
460
453
|
constructRoutes(this.owner, [testedRoute]);
|
461
454
|
|
@@ -465,8 +458,6 @@ module('Ember Debug - profile manager component highlight', function (hooks) {
|
|
465
458
|
});
|
466
459
|
|
467
460
|
test('Highlight is not supported, should not highlight one rootNode Glimmer component', async function (assert) {
|
468
|
-
assert.expect(3);
|
469
|
-
|
470
461
|
const testedRoute = 'one-root-glimmer-route';
|
471
462
|
constructRoutes(this.owner, [testedRoute]);
|
472
463
|
|
@@ -476,8 +467,6 @@ module('Ember Debug - profile manager component highlight', function (hooks) {
|
|
476
467
|
});
|
477
468
|
|
478
469
|
test('Should highlight two rootNode ([rootNode, rootNode] and no tagName) Ember component', async function (assert) {
|
479
|
-
assert.expect(isComponentHighlightSupported ? 11 : 4);
|
480
|
-
|
481
470
|
const testedRoute = 'two-root-route';
|
482
471
|
constructRoutes(this.owner, [testedRoute]);
|
483
472
|
|
@@ -487,8 +476,6 @@ module('Ember Debug - profile manager component highlight', function (hooks) {
|
|
487
476
|
});
|
488
477
|
|
489
478
|
test('Highlight is not supported, should not highlight two rootNode ([rootNode, rootNode] and no tagName) Glimmer component', async function (assert) {
|
490
|
-
assert.expect(4);
|
491
|
-
|
492
479
|
const testedRoute = 'two-root-glimmer-route';
|
493
480
|
constructRoutes(this.owner, [testedRoute]);
|
494
481
|
|
@@ -498,8 +485,6 @@ module('Ember Debug - profile manager component highlight', function (hooks) {
|
|
498
485
|
});
|
499
486
|
|
500
487
|
test('Should highlight two rootNode with one comment ([rootNode, commentNode, rootNode] and no tagName) Ember component', async function (assert) {
|
501
|
-
assert.expect(isComponentHighlightSupported ? 11 : 4);
|
502
|
-
|
503
488
|
const testedRoute = 'root-comment-root-route';
|
504
489
|
constructRoutes(this.owner, [testedRoute]);
|
505
490
|
|
@@ -509,8 +494,6 @@ module('Ember Debug - profile manager component highlight', function (hooks) {
|
|
509
494
|
});
|
510
495
|
|
511
496
|
test('Highlight is not supported, should not highlight two rootNode with one comment ([rootNode, commentNode, rootNode] and no tagName) Glimmer component', async function (assert) {
|
512
|
-
assert.expect(4);
|
513
|
-
|
514
497
|
const testedRoute = 'root-comment-root-glimmer-route';
|
515
498
|
constructRoutes(this.owner, [testedRoute]);
|
516
499
|
|
@@ -520,8 +503,6 @@ module('Ember Debug - profile manager component highlight', function (hooks) {
|
|
520
503
|
});
|
521
504
|
|
522
505
|
test('Should highlight one rootNode with two comment ([commentNode, rootNode, commentNode] and no tagName) Ember component', async function (assert) {
|
523
|
-
assert.expect(isComponentHighlightSupported ? 6 : 3);
|
524
|
-
|
525
506
|
const testedRoute = 'comment-root-comment-route';
|
526
507
|
constructRoutes(this.owner, [testedRoute]);
|
527
508
|
|
@@ -531,8 +512,6 @@ module('Ember Debug - profile manager component highlight', function (hooks) {
|
|
531
512
|
});
|
532
513
|
|
533
514
|
test('Highlight is not supported, should not highlight one rootNode with two comment ([commentNode, rootNode, commentNode] and no tagName) Glimmer component', async function (assert) {
|
534
|
-
assert.expect(3);
|
535
|
-
|
536
515
|
const testedRoute = 'comment-root-comment-glimmer-route';
|
537
516
|
constructRoutes(this.owner, [testedRoute]);
|
538
517
|
|
@@ -542,8 +521,6 @@ module('Ember Debug - profile manager component highlight', function (hooks) {
|
|
542
521
|
});
|
543
522
|
|
544
523
|
test('Should highlight tagName div Ember component', async function (assert) {
|
545
|
-
assert.expect(isComponentHighlightSupported ? 6 : 3);
|
546
|
-
|
547
524
|
const testedRoute = 'div-tag-route';
|
548
525
|
constructRoutes(this.owner, [testedRoute]);
|
549
526
|
|
@@ -553,8 +530,6 @@ module('Ember Debug - profile manager component highlight', function (hooks) {
|
|
553
530
|
});
|
554
531
|
|
555
532
|
test('Should highlight two rootNode ([rootNode, rootNode] and tagName div) Ember component', async function (assert) {
|
556
|
-
assert.expect(isComponentHighlightSupported ? 6 : 3);
|
557
|
-
|
558
533
|
const testedRoute = 'div-roots-route';
|
559
534
|
constructRoutes(this.owner, [testedRoute]);
|
560
535
|
|
@@ -35,12 +35,12 @@ module('Ember Debug - ProfileNode', function () {
|
|
35
35
|
|
36
36
|
assert.notOk(
|
37
37
|
p1.parent,
|
38
|
-
'Without a parent parameter, the attribute is not set'
|
38
|
+
'Without a parent parameter, the attribute is not set',
|
39
39
|
);
|
40
40
|
assert.strictEqual(
|
41
41
|
p2.parent,
|
42
42
|
p1,
|
43
|
-
"If passed, p2's parent is assigned to p1"
|
43
|
+
"If passed, p2's parent is assigned to p1",
|
44
44
|
);
|
45
45
|
assert.notOk(p1.time, "p1 has no time because it's unfinished");
|
46
46
|
assert.notOk(p2.time, "p2 has no time because it's unfinished");
|
@@ -70,7 +70,7 @@ module('Ember Debug - ProfileNode', function () {
|
|
70
70
|
|
71
71
|
assert.ok(
|
72
72
|
JSON.stringify(p1),
|
73
|
-
'it can serialize due to no cycles in the object'
|
73
|
+
'it can serialize due to no cycles in the object',
|
74
74
|
);
|
75
75
|
});
|
76
76
|
|
@@ -9,18 +9,21 @@ let assembler;
|
|
9
9
|
let fakeRSVP;
|
10
10
|
|
11
11
|
function stubRSVP() {
|
12
|
+
// eslint-disable-next-line ember/no-classic-classes
|
12
13
|
fakeRSVP = EmberObject.extend(Evented, {
|
13
14
|
configure() {},
|
14
15
|
}).create();
|
15
16
|
}
|
16
17
|
|
17
18
|
function startAssembler() {
|
19
|
+
// eslint-disable-next-line ember/no-runloop
|
18
20
|
run(assembler, 'start');
|
19
21
|
}
|
20
22
|
|
21
23
|
module('Ember Debug - PromiseAssembler', function (hooks) {
|
22
24
|
hooks.beforeEach(() => {
|
23
25
|
stubRSVP();
|
26
|
+
// eslint-disable-next-line ember/no-runloop
|
24
27
|
run(function () {
|
25
28
|
assembler = new PromiseAssembler({
|
26
29
|
RSVP: fakeRSVP,
|
@@ -30,6 +33,7 @@ module('Ember Debug - PromiseAssembler', function (hooks) {
|
|
30
33
|
|
31
34
|
hooks.afterEach(() => {
|
32
35
|
if (assembler) {
|
36
|
+
// eslint-disable-next-line ember/no-runloop
|
33
37
|
run(assembler, 'destroy');
|
34
38
|
assembler = null;
|
35
39
|
}
|
@@ -55,7 +59,7 @@ module('Ember Debug - PromiseAssembler', function (hooks) {
|
|
55
59
|
let promise = event.promise;
|
56
60
|
assert.strictEqual(event.promise, assembler.find(promise['guid']));
|
57
61
|
|
58
|
-
assert.strictEqual(assembler.find().
|
62
|
+
assert.strictEqual(assembler.find().length, 1);
|
59
63
|
|
60
64
|
assert.strictEqual(promise['guid'], 1);
|
61
65
|
assert.strictEqual(promise['label'], 'label');
|
@@ -88,7 +92,7 @@ module('Ember Debug - PromiseAssembler', function (hooks) {
|
|
88
92
|
assert.strictEqual(assembler.find(parent['guid']), parent);
|
89
93
|
assert.strictEqual(assembler.find(child['guid']), child);
|
90
94
|
|
91
|
-
assert.strictEqual(assembler.find().
|
95
|
+
assert.strictEqual(assembler.find().length, 2);
|
92
96
|
|
93
97
|
assert.strictEqual(parent['guid'], 1);
|
94
98
|
assert.strictEqual(parent['label'], 'label');
|
@@ -147,7 +151,7 @@ module('Ember Debug - PromiseAssembler', function (hooks) {
|
|
147
151
|
assert.strictEqual(assembler.find(parent['guid']), parent);
|
148
152
|
assert.strictEqual(assembler.find(child['guid']), child);
|
149
153
|
|
150
|
-
assert.strictEqual(assembler.find().
|
154
|
+
assert.strictEqual(assembler.find().length, 2);
|
151
155
|
|
152
156
|
assert.strictEqual(parent['guid'], 1);
|
153
157
|
assert.strictEqual(parent['label'], 'label');
|
@@ -230,26 +234,25 @@ module('Ember Debug - PromiseAssembler', function (hooks) {
|
|
230
234
|
assert.strictEqual(promise['state'], 'rejected');
|
231
235
|
assert.strictEqual(promise['reason'], 'reason');
|
232
236
|
assert.strictEqual(promise['settledAt'], date);
|
233
|
-
assert.strictEqual(assembler.find().
|
237
|
+
assert.strictEqual(assembler.find().length, 1);
|
234
238
|
});
|
235
239
|
|
236
240
|
test('#stop', function (assert) {
|
237
|
-
assert.expect(3);
|
238
|
-
|
239
241
|
startAssembler();
|
240
242
|
|
241
243
|
fakeRSVP.trigger('created', {
|
242
244
|
guid: 1,
|
243
245
|
});
|
244
|
-
assert.strictEqual(assembler.find().
|
246
|
+
assert.strictEqual(assembler.find().length, 1);
|
245
247
|
|
248
|
+
// eslint-disable-next-line ember/no-runloop
|
246
249
|
run(assembler, 'stop');
|
247
250
|
|
248
|
-
assert.strictEqual(assembler.find().
|
251
|
+
assert.strictEqual(assembler.find().length, 0);
|
249
252
|
assembler.on('created', function () {
|
250
253
|
assert.ok(false);
|
251
254
|
});
|
252
255
|
fakeRSVP.trigger('created', { guid: 1 });
|
253
|
-
assert.strictEqual(assembler.find().
|
256
|
+
assert.strictEqual(assembler.find().length, 0);
|
254
257
|
});
|
255
258
|
});
|
@@ -1,3 +1,4 @@
|
|
1
|
+
/* eslint-disable ember/no-runloop */
|
1
2
|
/* eslint-disable ember/avoid-leaking-state-in-ember-objects */
|
2
3
|
import { run, later } from '@ember/runloop';
|
3
4
|
import { A as emberA } from '@ember/array';
|
@@ -56,9 +57,9 @@ module('Ember Debug - Promise Debug', function (hooks) {
|
|
56
57
|
|
57
58
|
let promises = emberA(message.promises);
|
58
59
|
|
59
|
-
promise1 = promises.
|
60
|
-
child1 = promises.
|
61
|
-
promise2 = promises.
|
60
|
+
promise1 = promises.find((x) => x.label === 'Promise1');
|
61
|
+
child1 = promises.find((x) => x.label === 'Child1');
|
62
|
+
promise2 = promises.find((x) => x.label === 'Promise2');
|
62
63
|
|
63
64
|
assert.strictEqual(promise1.label, 'Promise1');
|
64
65
|
assert.strictEqual(promise1.state, 'fulfilled');
|
@@ -74,8 +75,6 @@ module('Ember Debug - Promise Debug', function (hooks) {
|
|
74
75
|
});
|
75
76
|
|
76
77
|
test('Updates are published when they happen', function (assert) {
|
77
|
-
assert.expect(8);
|
78
|
-
|
79
78
|
EmberDebug.port.trigger('promise:getAndObservePromises');
|
80
79
|
|
81
80
|
let p;
|
@@ -88,7 +87,7 @@ module('Ember Debug - Promise Debug', function (hooks) {
|
|
88
87
|
later(function () {
|
89
88
|
assert.strictEqual(name, 'promise:promisesUpdated');
|
90
89
|
let promises = emberA(message.promises);
|
91
|
-
let promise = promises.
|
90
|
+
let promise = promises.find((x) => x.label === 'Promise1');
|
92
91
|
assert.ok(!!promise);
|
93
92
|
if (promise) {
|
94
93
|
assert.strictEqual(promise.label, 'Promise1');
|