ember-inspector 4.13.1-alpha.2024.8.8 → 4.13.1-alpha.2025.6.7
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.6a5edcbbcf29cbe1b167.js +40 -0
- package/dist/bookmarklet/panes-3-16-0/assets/chunk.582.b77d8494154b524e9f91.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.6a5edcbbcf29cbe1b167.js +40 -0
- package/dist/chrome/panes-3-16-0/assets/chunk.582.b77d8494154b524e9f91.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.6a5edcbbcf29cbe1b167.js +40 -0
- package/dist/firefox/panes-3-16-0/assets/chunk.582.b77d8494154b524e9f91.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.6a5edcbbcf29cbe1b167.js +40 -0
- package/dist/websocket/assets/chunk.582.b77d8494154b524e9f91.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.152107b52f1d9b56abd2.js +0 -28
- package/dist/bookmarklet/panes-3-16-0/assets/chunk.178.fd17fd3a54b4e3a24554.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.152107b52f1d9b56abd2.js +0 -28
- package/dist/chrome/panes-3-16-0/assets/chunk.178.fd17fd3a54b4e3a24554.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.152107b52f1d9b56abd2.js +0 -28
- package/dist/firefox/panes-3-16-0/assets/chunk.178.fd17fd3a54b4e3a24554.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.152107b52f1d9b56abd2.js +0 -28
- package/dist/websocket/assets/chunk.178.fd17fd3a54b4e3a24554.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
@@ -2,13 +2,14 @@ import {
|
|
2
2
|
setupApplicationTest as upstreamSetupApplicationTest,
|
3
3
|
setupRenderingTest as upstreamSetupRenderingTest,
|
4
4
|
setupTest as upstreamSetupTest,
|
5
|
+
type SetupTestOptions,
|
5
6
|
} from 'ember-qunit';
|
6
7
|
|
7
|
-
// This file exists to provide wrappers around ember-qunit's
|
8
|
+
// This file exists to provide wrappers around ember-qunit's
|
8
9
|
// test setup functions. This way, you can easily extend the setup that is
|
9
10
|
// needed per test type.
|
10
11
|
|
11
|
-
function setupApplicationTest(hooks, options) {
|
12
|
+
function setupApplicationTest(hooks: NestedHooks, options?: SetupTestOptions) {
|
12
13
|
upstreamSetupApplicationTest(hooks, options);
|
13
14
|
|
14
15
|
// Additional setup for application tests can be done here.
|
@@ -23,17 +24,17 @@ function setupApplicationTest(hooks, options) {
|
|
23
24
|
// This is also a good place to call test setup functions coming
|
24
25
|
// from other addons:
|
25
26
|
//
|
26
|
-
// setupIntl(hooks); // ember-intl
|
27
|
+
// setupIntl(hooks, 'en-us'); // ember-intl
|
27
28
|
// setupMirage(hooks); // ember-cli-mirage
|
28
29
|
}
|
29
30
|
|
30
|
-
function setupRenderingTest(hooks, options) {
|
31
|
+
function setupRenderingTest(hooks: NestedHooks, options?: SetupTestOptions) {
|
31
32
|
upstreamSetupRenderingTest(hooks, options);
|
32
33
|
|
33
34
|
// Additional setup for rendering tests can be done here.
|
34
35
|
}
|
35
36
|
|
36
|
-
function setupTest(hooks, options) {
|
37
|
+
function setupTest(hooks: NestedHooks, options?: SetupTestOptions) {
|
37
38
|
upstreamSetupTest(hooks, options);
|
38
39
|
|
39
40
|
// Additional setup for unit tests can be done here.
|
@@ -1,3 +1,4 @@
|
|
1
|
+
/* eslint-disable ember/no-runloop */
|
1
2
|
import Application from '@ember/application';
|
2
3
|
import Resolver from 'ember-resolver';
|
3
4
|
import EmberRouter from '@ember/routing/router';
|
@@ -9,6 +10,8 @@ import {
|
|
9
10
|
teardownContext,
|
10
11
|
} from '@ember/test-helpers';
|
11
12
|
import { run } from '@ember/runloop';
|
13
|
+
import Route from '@ember/routing/route';
|
14
|
+
import Controller from '@ember/controller';
|
12
15
|
import BasicAdapter from 'ember-inspector/services/adapters/basic';
|
13
16
|
import config from 'ember-inspector/config/environment';
|
14
17
|
import EmberDebug from 'ember-debug/main';
|
@@ -33,6 +36,7 @@ export default function setupEmberDebugTest(hooks, options = {}) {
|
|
33
36
|
await setupContext(this);
|
34
37
|
await setupApplicationContext(this);
|
35
38
|
|
39
|
+
// eslint-disable-next-line ember/no-classic-classes
|
36
40
|
const Router = EmberRouter.extend({
|
37
41
|
location: 'none',
|
38
42
|
});
|
@@ -49,6 +53,16 @@ export default function setupEmberDebugTest(hooks, options = {}) {
|
|
49
53
|
|
50
54
|
this.owner.register('router:main', Router);
|
51
55
|
this.owner.register('service:adapter', BasicAdapter);
|
56
|
+
/**
|
57
|
+
* preferably, ember debug tests should use their own test app
|
58
|
+
* but currently its mangled with the inspector ui app, which is not compatible with all ember versions being tested.
|
59
|
+
* we do filter the tests to only run the ember_debug tests, but that does not prevent the app merging.
|
60
|
+
* The application route/controller/template of inspector ui was being indirectly used in ember_debug tests,
|
61
|
+
* which is not required and broke older lts tests
|
62
|
+
*/
|
63
|
+
this.owner.register('route:application', class extends Route {});
|
64
|
+
this.owner.register('controller:application', class extends Controller {});
|
65
|
+
this.owner.register('template:application', hbs('{{outlet}}'));
|
52
66
|
|
53
67
|
run(() => {
|
54
68
|
EmberDebug.isTesting = true;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { module, test } from 'qunit';
|
2
2
|
import { setupApplicationTest } from 'ember-qunit';
|
3
|
+
import Service from '@ember/service';
|
3
4
|
|
4
5
|
class ChromePort {
|
5
6
|
constructor(self, other) {
|
@@ -122,7 +123,7 @@ class ChromeApi {
|
|
122
123
|
},
|
123
124
|
sendMessage(msg) {
|
124
125
|
(self.backgroundScript || self.inspector).subscribers.forEach((sub) =>
|
125
|
-
sub(msg, self.sender)
|
126
|
+
sub(msg, self.sender),
|
126
127
|
);
|
127
128
|
},
|
128
129
|
onMessage: {
|
@@ -236,7 +237,6 @@ module('Integration | Injection', function (hooks) {
|
|
236
237
|
if (injected) return;
|
237
238
|
const backgroundScript = await (await fetch('/background.js')).text();
|
238
239
|
{
|
239
|
-
// eslint-disable-next-line no-unused-vars
|
240
240
|
const chrome = backgroundChromeApi;
|
241
241
|
eval(backgroundScript);
|
242
242
|
assert.strictEqual(chrome.onRemovedListeners.length, 1);
|
@@ -251,10 +251,10 @@ module('Integration | Injection', function (hooks) {
|
|
251
251
|
let windowMessages = 0;
|
252
252
|
|
253
253
|
// setup global loader for ember-debug, will be reset after test
|
254
|
-
|
254
|
+
|
255
255
|
const { define, requireModule } = getLoader(
|
256
256
|
window.define,
|
257
|
-
window.requireModule
|
257
|
+
window.requireModule,
|
258
258
|
);
|
259
259
|
window.define = define;
|
260
260
|
window.requireModule = requireModule;
|
@@ -262,7 +262,7 @@ module('Integration | Injection', function (hooks) {
|
|
262
262
|
// eslint-disable-next-line no-unused-vars
|
263
263
|
const chrome = contentChromeApi;
|
264
264
|
backgroundChromeApi.onTabActivatedListeners.forEach((act) =>
|
265
|
-
act({ tabId: 1 })
|
265
|
+
act({ tabId: 1 }),
|
266
266
|
);
|
267
267
|
eval(contentScript);
|
268
268
|
}
|
@@ -270,7 +270,7 @@ module('Integration | Injection', function (hooks) {
|
|
270
270
|
assert.strictEqual(
|
271
271
|
windowMessages,
|
272
272
|
0,
|
273
|
-
'content script should not send window messages'
|
273
|
+
'content script should not send window messages',
|
274
274
|
);
|
275
275
|
|
276
276
|
window.chrome = inspectorChromeApi;
|
@@ -290,6 +290,7 @@ module('Integration | Injection', function (hooks) {
|
|
290
290
|
}
|
291
291
|
});
|
292
292
|
});
|
293
|
+
owner.register('service:port', class extends Service {});
|
293
294
|
owner.lookup('service:adapters/web-extension');
|
294
295
|
await p;
|
295
296
|
await emberDebugStarted;
|
@@ -314,7 +315,6 @@ module('Integration | Injection', function (hooks) {
|
|
314
315
|
window.NO_EMBER_DEBUG = true;
|
315
316
|
});
|
316
317
|
|
317
|
-
// eslint-disable-next-line qunit/require-expect
|
318
318
|
test('inject ember debug via content and background scripts', async function (assert) {
|
319
319
|
await inject(this.owner, assert);
|
320
320
|
const { requireModule } = getLoader(window.define, window.requireModule);
|
@@ -322,25 +322,24 @@ module('Integration | Injection', function (hooks) {
|
|
322
322
|
assert.notStrictEqual(
|
323
323
|
emberDebug,
|
324
324
|
undefined,
|
325
|
-
'ember debug should be loaded'
|
325
|
+
'ember debug should be loaded',
|
326
326
|
);
|
327
327
|
});
|
328
328
|
|
329
|
-
// eslint-disable-next-line qunit/require-expect
|
330
329
|
test('add Inspect Ember Component Context Menu Item', async function (assert) {
|
331
330
|
await inject(this.owner, assert);
|
332
331
|
assert.true(
|
333
332
|
!!backgroundChromeApi.registeredContextMenus['inspect-ember-component'],
|
334
|
-
'should have registered context menu'
|
333
|
+
'should have registered context menu',
|
335
334
|
);
|
336
335
|
});
|
337
336
|
|
338
|
-
// eslint-disable-next-line qunit/require-expect
|
339
337
|
test('triggering Ember Component Context Menu Item should call inspect nearest', async function (assert) {
|
340
338
|
await inject(this.owner, assert);
|
341
|
-
assert.timeout(
|
339
|
+
assert.timeout(100);
|
342
340
|
|
343
|
-
const
|
341
|
+
const emberDebug = requireModule('ember-debug/main')['default'];
|
342
|
+
const viewInspection = emberDebug.viewDebug.viewInspection;
|
344
343
|
|
345
344
|
const inspectNearestCalled = new Promise((resolve) => {
|
346
345
|
viewInspection.inspectNearest = () => {
|
package/tests/test-adapter.js
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
/* eslint-disable no-console */
|
2
1
|
import QUnit from 'qunit';
|
3
2
|
import { next } from '@ember/runloop';
|
4
3
|
import BasicAdapter from 'ember-inspector/services/adapters/basic';
|
@@ -22,7 +21,7 @@ export function setupTestAdapter(hooks) {
|
|
22
21
|
applicationName: 'My App',
|
23
22
|
booted: true,
|
24
23
|
},
|
25
|
-
{ isDefault: true }
|
24
|
+
{ isDefault: true },
|
26
25
|
);
|
27
26
|
|
28
27
|
respondWith(
|
@@ -38,7 +37,7 @@ export function setupTestAdapter(hooks) {
|
|
38
37
|
},
|
39
38
|
],
|
40
39
|
},
|
41
|
-
{ isDefault: true }
|
40
|
+
{ isDefault: true },
|
42
41
|
);
|
43
42
|
|
44
43
|
respondWith('app-selected', false, { isDefault: true });
|
@@ -51,7 +50,7 @@ export function setupTestAdapter(hooks) {
|
|
51
50
|
applicationName,
|
52
51
|
count: 0,
|
53
52
|
}),
|
54
|
-
{ isDefault: true }
|
53
|
+
{ isDefault: true },
|
55
54
|
);
|
56
55
|
});
|
57
56
|
|
@@ -62,10 +61,10 @@ export function setupTestAdapter(hooks) {
|
|
62
61
|
assert.strictEqual(
|
63
62
|
actual,
|
64
63
|
expected,
|
65
|
-
`Expceting resouce ${file}:${line} to be opened ${expected} time(s)
|
64
|
+
`Expceting resouce ${file}:${line} to be opened ${expected} time(s)`,
|
66
65
|
);
|
67
66
|
reject(
|
68
|
-
`Expceting resouce ${file}:${line} to be opened ${expected} time(s), was opened ${actual} time(s)
|
67
|
+
`Expceting resouce ${file}:${line} to be opened ${expected} time(s), was opened ${actual} time(s)`,
|
69
68
|
);
|
70
69
|
}
|
71
70
|
}
|
@@ -75,7 +74,7 @@ export function setupTestAdapter(hooks) {
|
|
75
74
|
assert.strictEqual(
|
76
75
|
actual,
|
77
76
|
expected,
|
78
|
-
`The correct amount of ${type} messages are sent
|
77
|
+
`The correct amount of ${type} messages are sent`,
|
79
78
|
);
|
80
79
|
reject(`Expecting ${expected} ${type} messages, got ${actual}`);
|
81
80
|
}
|
@@ -142,6 +141,7 @@ export async function sendMessage(message) {
|
|
142
141
|
}
|
143
142
|
|
144
143
|
const msg = await new Promise((resolve, reject) => {
|
144
|
+
// eslint-disable-next-line ember/no-runloop
|
145
145
|
next(async () => {
|
146
146
|
let normalized = {
|
147
147
|
applicationId: 'my-app',
|
@@ -210,7 +210,7 @@ export function disableDefaultResponseFor(type) {
|
|
210
210
|
if (responder.type === type && responder.isDefault) {
|
211
211
|
if (responder.actual > 0) {
|
212
212
|
throw new Error(
|
213
|
-
`Cannot remove default responder for ${type}: a response has already been sent
|
213
|
+
`Cannot remove default responder for ${type}: a response has already been sent!`,
|
214
214
|
);
|
215
215
|
}
|
216
216
|
|
@@ -220,7 +220,7 @@ export function disableDefaultResponseFor(type) {
|
|
220
220
|
}
|
221
221
|
|
222
222
|
throw new Error(
|
223
|
-
`Cannot remove default responder for ${type}: no such responder
|
223
|
+
`Cannot remove default responder for ${type}: no such responder!`,
|
224
224
|
);
|
225
225
|
}
|
226
226
|
|
@@ -248,7 +248,7 @@ export default class TestAdapter extends BasicAdapter {
|
|
248
248
|
if (!file) {
|
249
249
|
QUnit.assert.ok(
|
250
250
|
file,
|
251
|
-
`resource has valid "file" field: ${JSON.stringify(file)}
|
251
|
+
`resource has valid "file" field: ${JSON.stringify(file)}`,
|
252
252
|
);
|
253
253
|
return;
|
254
254
|
}
|
@@ -256,7 +256,7 @@ export default class TestAdapter extends BasicAdapter {
|
|
256
256
|
if (!line) {
|
257
257
|
QUnit.assert.ok(
|
258
258
|
file,
|
259
|
-
`resource has valid "line" field: ${JSON.stringify(line)}
|
259
|
+
`resource has valid "line" field: ${JSON.stringify(line)}`,
|
260
260
|
);
|
261
261
|
return;
|
262
262
|
}
|
@@ -287,7 +287,7 @@ export default class TestAdapter extends BasicAdapter {
|
|
287
287
|
if (!message.type) {
|
288
288
|
QUnit.assert.ok(
|
289
289
|
false,
|
290
|
-
`message has valid "type" field: ${JSON.stringify(message)}
|
290
|
+
`message has valid "type" field: ${JSON.stringify(message)}`,
|
291
291
|
);
|
292
292
|
return;
|
293
293
|
}
|
@@ -296,7 +296,7 @@ export default class TestAdapter extends BasicAdapter {
|
|
296
296
|
QUnit.assert.strictEqual(
|
297
297
|
message.from,
|
298
298
|
'devtools',
|
299
|
-
`message has valid "from" field: ${JSON.stringify(message)}
|
299
|
+
`message has valid "from" field: ${JSON.stringify(message)}`,
|
300
300
|
);
|
301
301
|
return;
|
302
302
|
}
|
@@ -320,13 +320,13 @@ export default class TestAdapter extends BasicAdapter {
|
|
320
320
|
if (response) {
|
321
321
|
console.debug(
|
322
322
|
'Received response (inspectedWindow -> devtools)',
|
323
|
-
response
|
323
|
+
response,
|
324
324
|
);
|
325
325
|
didRespond = sendMessage(response);
|
326
326
|
} else if (response === false) {
|
327
327
|
console.debug(
|
328
328
|
'Ignoreing message (devtools -> inspectedWindow)',
|
329
|
-
message
|
329
|
+
message,
|
330
330
|
);
|
331
331
|
didRespond = Promise.resolve();
|
332
332
|
}
|
package/tests/test-helper.js
CHANGED
@@ -13,8 +13,13 @@ import 'ember-debug/main';
|
|
13
13
|
|
14
14
|
registerWaiter();
|
15
15
|
|
16
|
+
/**
|
17
|
+
* we need to override the adapter that is set up in initializers/setup.js
|
18
|
+
* for that we suffix the name of setup initializer with `-2` so that
|
19
|
+
* this initializer comes right after it
|
20
|
+
*/
|
16
21
|
Application.initializer({
|
17
|
-
name: `
|
22
|
+
name: `setup-2-override-adapter`,
|
18
23
|
initialize(app) {
|
19
24
|
app.register('service:adapter', TestAdapter);
|
20
25
|
},
|
@@ -3,8 +3,6 @@ import { module, test } from 'qunit';
|
|
3
3
|
|
4
4
|
module('Unit | Helper | checkCurrentRoute', function () {
|
5
5
|
test('matches the correct routes', function (assert) {
|
6
|
-
assert.expect(8);
|
7
|
-
|
8
6
|
const testSet = [
|
9
7
|
{
|
10
8
|
currentRoute: {
|
@@ -102,8 +100,6 @@ module('Unit | Helper | checkCurrentRoute', function () {
|
|
102
100
|
});
|
103
101
|
|
104
102
|
test('does not match incorrect routes', function (assert) {
|
105
|
-
assert.expect(4);
|
106
|
-
|
107
103
|
const testSet = [
|
108
104
|
{
|
109
105
|
currentRoute: {
|
@@ -82,34 +82,34 @@ module('Unit | Lib | ResizableColumns', function (hooks) {
|
|
82
82
|
assert.strictEqual(
|
83
83
|
resizableColumns.columns[0].width,
|
84
84
|
5,
|
85
|
-
'first column should have the correct width'
|
85
|
+
'first column should have the correct width',
|
86
86
|
);
|
87
87
|
assert.strictEqual(
|
88
88
|
resizableColumns.columns[1].width,
|
89
89
|
10,
|
90
|
-
'second column should have the correct width'
|
90
|
+
'second column should have the correct width',
|
91
91
|
);
|
92
92
|
assert.strictEqual(
|
93
93
|
resizableColumns.columns[2].width,
|
94
94
|
15,
|
95
|
-
'last column should have the correct width'
|
95
|
+
'last column should have the correct width',
|
96
96
|
);
|
97
97
|
|
98
98
|
resizableColumns.updateColumnWidth('1', 15);
|
99
99
|
assert.strictEqual(
|
100
100
|
resizableColumns.columns[0].width,
|
101
101
|
15,
|
102
|
-
'first column should have the correct width'
|
102
|
+
'first column should have the correct width',
|
103
103
|
);
|
104
104
|
assert.strictEqual(
|
105
105
|
resizableColumns.columns[1].width,
|
106
106
|
10,
|
107
|
-
'second column should have the correct width'
|
107
|
+
'second column should have the correct width',
|
108
108
|
);
|
109
109
|
assert.strictEqual(
|
110
110
|
resizableColumns.columns[2].width,
|
111
111
|
5,
|
112
|
-
'last column should have the correct width'
|
112
|
+
'last column should have the correct width',
|
113
113
|
);
|
114
114
|
|
115
115
|
// Check if it caches the updated widths
|
@@ -118,34 +118,34 @@ module('Unit | Lib | ResizableColumns', function (hooks) {
|
|
118
118
|
assert.strictEqual(
|
119
119
|
resizableColumns.columns[0].width,
|
120
120
|
15,
|
121
|
-
'first column should have the correct width'
|
121
|
+
'first column should have the correct width',
|
122
122
|
);
|
123
123
|
assert.strictEqual(
|
124
124
|
resizableColumns.columns[1].width,
|
125
125
|
10,
|
126
|
-
'second column should have the correct width'
|
126
|
+
'second column should have the correct width',
|
127
127
|
);
|
128
128
|
assert.strictEqual(
|
129
129
|
resizableColumns.columns[2].width,
|
130
130
|
5,
|
131
|
-
'last column should have the correct width'
|
131
|
+
'last column should have the correct width',
|
132
132
|
);
|
133
133
|
|
134
134
|
resizableColumns.resetWidths();
|
135
135
|
assert.strictEqual(
|
136
136
|
resizableColumns.columns[0].width,
|
137
137
|
10,
|
138
|
-
'first column should have the correct width'
|
138
|
+
'first column should have the correct width',
|
139
139
|
);
|
140
140
|
assert.strictEqual(
|
141
141
|
resizableColumns.columns[1].width,
|
142
142
|
10,
|
143
|
-
'second column should have the correct width'
|
143
|
+
'second column should have the correct width',
|
144
144
|
);
|
145
145
|
assert.strictEqual(
|
146
146
|
resizableColumns.columns[2].width,
|
147
147
|
10,
|
148
|
-
'last column should have the correct width'
|
148
|
+
'last column should have the correct width',
|
149
149
|
);
|
150
150
|
|
151
151
|
// Table width upate
|
@@ -153,17 +153,17 @@ module('Unit | Lib | ResizableColumns', function (hooks) {
|
|
153
153
|
assert.strictEqual(
|
154
154
|
resizableColumns.columns[0].width,
|
155
155
|
5,
|
156
|
-
'first column should have the correct width'
|
156
|
+
'first column should have the correct width',
|
157
157
|
);
|
158
158
|
assert.strictEqual(
|
159
159
|
resizableColumns.columns[1].width,
|
160
160
|
5,
|
161
|
-
'second column should have the correct width'
|
161
|
+
'second column should have the correct width',
|
162
162
|
);
|
163
163
|
assert.strictEqual(
|
164
164
|
resizableColumns.columns[2].width,
|
165
165
|
5,
|
166
|
-
'last column should have the correct width'
|
166
|
+
'last column should have the correct width',
|
167
167
|
);
|
168
168
|
});
|
169
169
|
|
@@ -173,12 +173,12 @@ module('Unit | Lib | ResizableColumns', function (hooks) {
|
|
173
173
|
assert.strictEqual(
|
174
174
|
this.options.storage.keys().length,
|
175
175
|
1,
|
176
|
-
'Only uses one key'
|
176
|
+
'Only uses one key',
|
177
177
|
);
|
178
178
|
assert.strictEqual(
|
179
179
|
this.options.storage.keys()[0],
|
180
|
-
'
|
181
|
-
'Uses the correct key'
|
180
|
+
'list-my-key',
|
181
|
+
'Uses the correct key',
|
182
182
|
);
|
183
183
|
});
|
184
184
|
|
@@ -188,59 +188,62 @@ module('Unit | Lib | ResizableColumns', function (hooks) {
|
|
188
188
|
resizableColumns.build();
|
189
189
|
|
190
190
|
assert.deepEqual(
|
191
|
-
resizableColumns.columns
|
191
|
+
resizableColumns.columns
|
192
|
+
.filter((col) => col.visible)
|
193
|
+
.map((col) => col.id),
|
192
194
|
['1', '2'],
|
193
|
-
'shows/hides according to schema'
|
195
|
+
'shows/hides according to schema',
|
196
|
+
);
|
197
|
+
assert.deepEqual(
|
198
|
+
resizableColumns.getColumnVisibility().map((col) => col.visible),
|
199
|
+
[true, true, false],
|
194
200
|
);
|
195
|
-
assert.deepEqual(resizableColumns.getColumnVisibility().mapBy('visible'), [
|
196
|
-
true,
|
197
|
-
true,
|
198
|
-
false,
|
199
|
-
]);
|
200
201
|
|
201
202
|
resizableColumns.toggleVisibility('3');
|
202
203
|
assert.deepEqual(
|
203
|
-
resizableColumns.columns
|
204
|
+
resizableColumns.columns
|
205
|
+
.filter((col) => col.visible)
|
206
|
+
.map((col) => col.id),
|
204
207
|
['1', '2', '3'],
|
205
|
-
'toggles the third column correctly'
|
208
|
+
'toggles the third column correctly',
|
209
|
+
);
|
210
|
+
assert.deepEqual(
|
211
|
+
resizableColumns.getColumnVisibility().map((col) => col.visible),
|
212
|
+
[true, true, true],
|
206
213
|
);
|
207
|
-
assert.deepEqual(resizableColumns.getColumnVisibility().mapBy('visible'), [
|
208
|
-
true,
|
209
|
-
true,
|
210
|
-
true,
|
211
|
-
]);
|
212
214
|
|
213
215
|
resizableColumns.toggleVisibility('1');
|
214
216
|
assert.deepEqual(
|
215
|
-
resizableColumns.columns
|
217
|
+
resizableColumns.columns
|
218
|
+
.filter((col) => col.visible)
|
219
|
+
.map((col) => col.id),
|
216
220
|
['2', '3'],
|
217
|
-
'toggles the first column correctly'
|
221
|
+
'toggles the first column correctly',
|
222
|
+
);
|
223
|
+
assert.deepEqual(
|
224
|
+
resizableColumns.getColumnVisibility().map((col) => col.visible),
|
225
|
+
[false, true, true],
|
218
226
|
);
|
219
|
-
assert.deepEqual(resizableColumns.getColumnVisibility().mapBy('visible'), [
|
220
|
-
false,
|
221
|
-
true,
|
222
|
-
true,
|
223
|
-
]);
|
224
227
|
|
225
228
|
// Confirm correct caching
|
226
229
|
resizableColumns = new ResizableColumns(this.options);
|
227
230
|
resizableColumns.build();
|
228
231
|
assert.deepEqual(
|
229
|
-
resizableColumns.columns
|
232
|
+
resizableColumns.columns
|
233
|
+
.filter((col) => col.visible)
|
234
|
+
.map((col) => col.id),
|
230
235
|
['2', '3'],
|
231
|
-
'caching overrides schema visibility settings'
|
236
|
+
'caching overrides schema visibility settings',
|
237
|
+
);
|
238
|
+
assert.deepEqual(
|
239
|
+
resizableColumns.getColumnVisibility().map((col) => col.visible),
|
240
|
+
[false, true, true],
|
232
241
|
);
|
233
|
-
assert.deepEqual(resizableColumns.getColumnVisibility().mapBy('visible'), [
|
234
|
-
false,
|
235
|
-
true,
|
236
|
-
true,
|
237
|
-
]);
|
238
242
|
});
|
239
243
|
|
240
244
|
test("resets cache correctly if schema doesn't match cache", function (assert) {
|
241
|
-
assert.expect(1);
|
242
245
|
this.options.storage.removeItem = (key) => {
|
243
|
-
assert.strictEqual(key, '
|
246
|
+
assert.strictEqual(key, 'list-my-key', 'cache was cleared');
|
244
247
|
};
|
245
248
|
let resizableColumns = new ResizableColumns(this.options);
|
246
249
|
resizableColumns.build();
|
@@ -257,10 +260,9 @@ module('Unit | Lib | ResizableColumns', function (hooks) {
|
|
257
260
|
|
258
261
|
test('clears expired cache', function (assert) {
|
259
262
|
let sixtyDaysAgo = 1000 * 60 * 60 * 24 * 30 * 2;
|
260
|
-
storage['
|
261
|
-
assert.expect(1);
|
263
|
+
storage['list-my-key'] = { updatedAt: Date.now() - sixtyDaysAgo };
|
262
264
|
this.options.storage.removeItem = (key) => {
|
263
|
-
assert.strictEqual(key, '
|
265
|
+
assert.strictEqual(key, 'list-my-key', 'cache was cleared');
|
264
266
|
};
|
265
267
|
let resizableColumns = new ResizableColumns(this.options);
|
266
268
|
resizableColumns.build();
|
@@ -7,18 +7,18 @@ module('Unit | Utility | parseText', function () {
|
|
7
7
|
assert.strictEqual(
|
8
8
|
parseText('foo'),
|
9
9
|
'foo',
|
10
|
-
'does not add quotes for string'
|
10
|
+
'does not add quotes for string',
|
11
11
|
);
|
12
12
|
assert.strictEqual(
|
13
13
|
parseText('"foo"'),
|
14
14
|
'foo',
|
15
|
-
'removes quotes when simple string is already wrapped in quotes'
|
15
|
+
'removes quotes when simple string is already wrapped in quotes',
|
16
16
|
);
|
17
17
|
assert.strictEqual(parseText('1'), 1);
|
18
18
|
assert.strictEqual(
|
19
19
|
parseText('"{"name":"teddy"}"'),
|
20
20
|
'{"name":"teddy"}',
|
21
|
-
'removes quotes around JSON strings'
|
21
|
+
'removes quotes around JSON strings',
|
22
22
|
);
|
23
23
|
});
|
24
24
|
});
|
@@ -5,27 +5,27 @@ module('Unit | Utility | searchMatch', function () {
|
|
5
5
|
test('searchMatch returns the correct results', function (assert) {
|
6
6
|
assert.ok(
|
7
7
|
searchMatch('something-component-test', 'something'),
|
8
|
-
'simple search with dash in text'
|
8
|
+
'simple search with dash in text',
|
9
9
|
);
|
10
10
|
|
11
11
|
assert.ok(
|
12
12
|
searchMatch('something-component-test', 'something-comp'),
|
13
|
-
'content with dash; query with dash'
|
13
|
+
'content with dash; query with dash',
|
14
14
|
);
|
15
15
|
|
16
16
|
assert.ok(
|
17
17
|
searchMatch('something-component-test', 'somethingcomp'),
|
18
|
-
'content with dash; query without dash'
|
18
|
+
'content with dash; query without dash',
|
19
19
|
);
|
20
20
|
|
21
21
|
assert.ok(
|
22
22
|
searchMatch('Something-component-test', 'somethingComp'),
|
23
|
-
'content with dash and capital; query with capital and without dash'
|
23
|
+
'content with dash and capital; query with capital and without dash',
|
24
24
|
);
|
25
25
|
|
26
26
|
assert.notOk(
|
27
27
|
searchMatch('Something-component-test', 'xxx'),
|
28
|
-
'match not found'
|
28
|
+
'match not found',
|
29
29
|
);
|
30
30
|
});
|
31
31
|
});
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { inspect } from 'ember-debug/utils/type-check';
|
2
|
+
import { module, test } from 'qunit';
|
3
|
+
|
4
|
+
module('Unit | Utility | type-check', function () {
|
5
|
+
test('inspect | An POJO with Symbols is correctly transformed into preview', async function (assert) {
|
6
|
+
let symbol = Symbol('test');
|
7
|
+
let symbolValue = Symbol('value');
|
8
|
+
|
9
|
+
let inspected = {
|
10
|
+
[symbol]: 'Symbol Value',
|
11
|
+
symbolVal: symbolValue,
|
12
|
+
};
|
13
|
+
|
14
|
+
let obj = inspect(inspected);
|
15
|
+
|
16
|
+
assert.deepEqual(
|
17
|
+
obj,
|
18
|
+
'{ symbolVal: Symbol(value) }',
|
19
|
+
'object is in expected shape',
|
20
|
+
);
|
21
|
+
});
|
22
|
+
});
|
package/tsconfig.json
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
// layout, which is not resolvable with the Node resolution algorithm, to
|
6
6
|
// work with TypeScript.
|
7
7
|
"baseUrl": ".",
|
8
|
+
"lib": ["ES2023", "DOM"],
|
8
9
|
"paths": {
|
9
10
|
"ember-debug/deps/*": ["node_modules/*"],
|
10
11
|
"ember-debug/*": ["ember_debug/*"],
|
@@ -15,7 +16,8 @@
|
|
15
16
|
"ui/test-support": ["lib/ui/addon-test-support"],
|
16
17
|
"ui/test-support/*": ["lib/ui/addon-test-support/*"],
|
17
18
|
"*": ["types/*"]
|
18
|
-
}
|
19
|
+
},
|
20
|
+
"types": ["chrome", "./node_modules/ember-source/types/stable"]
|
19
21
|
},
|
20
22
|
"include": ["app/**/*", "tests/**/*", "types/**/*", "lib/ui/**/*"]
|
21
23
|
}
|
@@ -3,7 +3,8 @@ import Ember from 'ember';
|
|
3
3
|
declare global {
|
4
4
|
// Prevents ESLint from "fixing" this via its auto-fix to turn it into a type
|
5
5
|
// alias (e.g. after running any Ember CLI generator)
|
6
|
-
|
6
|
+
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
7
8
|
interface Array<T> extends Ember.ArrayPrototypeExtensions<T> {}
|
8
9
|
// interface Function extends Ember.FunctionPrototypeExtensions {}
|
9
10
|
}
|
package/types/global.d.ts
CHANGED