Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't treat lazy tree items as leaf nodes #1023

Merged

Conversation

tao-cumplido
Copy link
Contributor

@tao-cumplido tao-cumplido commented Nov 22, 2022

fixes #1022

Prevent lazy tree items to be considered a leaf node.

@vercel
Copy link

vercel bot commented Nov 22, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
shoelace ✅ Ready (Inspect) Visit Preview Nov 22, 2022 at 9:41PM (UTC)

@tao-cumplido
Copy link
Contributor Author

tao-cumplido commented Nov 23, 2022

I had some tests failing for Firefox and Webkit, but they seemed unrelated to this change. I then noticed that the tests all pass on MacOS and the tests only failed on Windows. There appear to be some underlying problems in web-test-runner on Windows, unfortunately I have no experience with it. I put the console output below.

Also, I am uncertain whether to add an additional test and if it should be added to tree-item, as the change was done only there, or to tree, as the problem was only noticeable with leaf selection mode.

Error while reading source maps for D:\Projects\projects\shoelace\node_modules\@open-wc\testing-helpers\src\helpers.js
Error: You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer
    at readWasm (D:\Projects\projects\shoelace\node_modules\source-map\lib\read-wasm.js:8:13)
    at wasm (D:\Projects\projects\shoelace\node_modules\source-map\lib\wasm.js:25:16)
    at D:\Projects\projects\shoelace\node_modules\source-map\lib\source-map-consumer.js:264:14
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async D:\Projects\projects\shoelace\node_modules\@web\test-runner-core\dist\server\plugins\api\createSourceMapFunction.js:96:28
    at async mapStackLocation (D:\Projects\projects\shoelace\node_modules\@web\test-runner-core\dist\server\plugins\api\parseBrowserResult.js:8:27)      
    at async formatLocation (D:\Projects\projects\shoelace\node_modules\@web\browser-logs\dist\parseStackTrace.js:65:26)
    at async Object.parseStackTrace (D:\Projects\projects\shoelace\node_modules\@web\browser-logs\dist\parseStackTrace.js:107:23)
    at async Promise.all (index 0)
    at async Object.deserialize (D:\Projects\projects\shoelace\node_modules\@web\browser-logs\dist\deserialize.js:105:9)
Error while reading source maps for D:\Projects\projects\shoelace\node_modules\@open-wc\testing-helpers\src\helpers.js
Error: You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer
    at readWasm (D:\Projects\projects\shoelace\node_modules\source-map\lib\read-wasm.js:8:13)
    at wasm (D:\Projects\projects\shoelace\node_modules\source-map\lib\wasm.js:25:16)
    at D:\Projects\projects\shoelace\node_modules\source-map\lib\source-map-consumer.js:264:14
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async D:\Projects\projects\shoelace\node_modules\@web\test-runner-core\dist\server\plugins\api\createSourceMapFunction.js:96:28
    at async mapStackLocation (D:\Projects\projects\shoelace\node_modules\@web\test-runner-core\dist\server\plugins\api\parseBrowserResult.js:8:27)      
    at async formatLocation (D:\Projects\projects\shoelace\node_modules\@web\browser-logs\dist\parseStackTrace.js:65:26)
    at async Object.parseStackTrace (D:\Projects\projects\shoelace\node_modules\@web\browser-logs\dist\parseStackTrace.js:107:23)
    at async Promise.all (index 0)
    at async Object.deserialize (D:\Projects\projects\shoelace\node_modules\@web\browser-logs\dist\deserialize.js:105:9)
keyboard.type: Target closed
    at Object.executeCommand (D:\Projects\projects\shoelace\node_modules\@web\test-runner-commands\dist\sendKeysPlugin.js:46:45)
    at TestRunnerApiPlugin._onCommand (D:\Projects\projects\shoelace\node_modules\@web\test-runner-core\dist\server\plugins\api\testRunnerApiPlugin.js:145:108) {
  name: 'Error'
}
Error while reading source maps for D:\Projects\projects\shoelace\dist\chunks\chunk.3NUIDU4I.js
Error: You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer
    at readWasm (D:\Projects\projects\shoelace\node_modules\source-map\lib\read-wasm.js:8:13)
    at wasm (D:\Projects\projects\shoelace\node_modules\source-map\lib\wasm.js:25:16)
    at D:\Projects\projects\shoelace\node_modules\source-map\lib\source-map-consumer.js:264:14
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async D:\Projects\projects\shoelace\node_modules\@web\test-runner-core\dist\server\plugins\api\createSourceMapFunction.js:96:28
    at async mapStackLocation (D:\Projects\projects\shoelace\node_modules\@web\test-runner-core\dist\server\plugins\api\parseBrowserResult.js:8:27)
    at async formatLocation (D:\Projects\projects\shoelace\node_modules\@web\browser-logs\dist\parseStackTrace.js:65:26)
    at async Object.parseStackTrace (D:\Projects\projects\shoelace\node_modules\@web\browser-logs\dist\parseStackTrace.js:107:23)
    at async replaceErrorStack (D:\Projects\projects\shoelace\node_modules\@web\test-runner-core\dist\server\plugins\api\parseBrowserErrors.js:8:23)
    at async D:\Projects\projects\shoelace\node_modules\@web\test-runner-core\dist\server\plugins\api\parseBrowserErrors.js:39:17
Error while reading source maps for D:\Projects\projects\shoelace\src\components\input\input.test.ts
Error: You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer
    at readWasm (D:\Projects\projects\shoelace\node_modules\source-map\lib\read-wasm.js:8:13)
    at wasm (D:\Projects\projects\shoelace\node_modules\source-map\lib\wasm.js:25:16)
    at D:\Projects\projects\shoelace\node_modules\source-map\lib\source-map-consumer.js:264:14
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async D:\Projects\projects\shoelace\node_modules\@web\test-runner-core\dist\server\plugins\api\createSourceMapFunction.js:96:28
    at async mapStackLocation (D:\Projects\projects\shoelace\node_modules\@web\test-runner-core\dist\server\plugins\api\parseBrowserResult.js:8:27)
    at async formatLocation (D:\Projects\projects\shoelace\node_modules\@web\browser-logs\dist\parseStackTrace.js:65:26)
    at async Object.parseStackTrace (D:\Projects\projects\shoelace\node_modules\@web\browser-logs\dist\parseStackTrace.js:107:23)
    at async replaceErrorStack (D:\Projects\projects\shoelace\node_modules\@web\test-runner-core\dist\server\plugins\api\parseBrowserErrors.js:8:23)
    at async D:\Projects\projects\shoelace\node_modules\@web\test-runner-core\dist\server\plugins\api\parseBrowserErrors.js:39:17
src\components\avatar\avatar.test.ts:

 🚧 Browser logs on Webkit:
      An error was thrown in a Promise outside a test. Did you forget to await a function or assertion?
      Error: waitUntil timed out after 1000ms
        at node_modules\@open-wc\testing-helpers\src\helpers.js:60:23
      An error was thrown in a Promise outside a test. Did you forget to await a function or assertion?
      Error: waitUntil timed out after 1000ms
        at node_modules\@open-wc\testing-helpers\src\helpers.js:60:23

 🚧 404 network requests:
    - bad_image

Error while reading source maps for D:\Projects\projects\shoelace\dist\chunks\chunk.3NUIDU4I.js
Error: You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer
    at readWasm (D:\Projects\projects\shoelace\node_modules\source-map\lib\read-wasm.js:8:13)
    at wasm (D:\Projects\projects\shoelace\node_modules\source-map\lib\wasm.js:25:16)
    at D:\Projects\projects\shoelace\node_modules\source-map\lib\source-map-consumer.js:264:14
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async D:\Projects\projects\shoelace\node_modules\@web\test-runner-core\dist\server\plugins\api\createSourceMapFunction.js:96:28
    at async mapStackLocation (D:\Projects\projects\shoelace\node_modules\@web\test-runner-core\dist\server\plugins\api\parseBrowserResult.js:8:27)
    at async formatLocation (D:\Projects\projects\shoelace\node_modules\@web\browser-logs\dist\parseStackTrace.js:65:26)
    at async Object.parseStackTrace (D:\Projects\projects\shoelace\node_modules\@web\browser-logs\dist\parseStackTrace.js:107:23)
    at async replaceErrorStack (D:\Projects\projects\shoelace\node_modules\@web\test-runner-core\dist\server\plugins\api\parseBrowserErrors.js:8:23)
    at async D:\Projects\projects\shoelace\node_modules\@web\test-runner-core\dist\server\plugins\api\parseBrowserErrors.js:39:17
Error while reading source maps for D:\Projects\projects\shoelace\src\components\input\input.test.ts
Error: You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer
    at readWasm (D:\Projects\projects\shoelace\node_modules\source-map\lib\read-wasm.js:8:13)
    at wasm (D:\Projects\projects\shoelace\node_modules\source-map\lib\wasm.js:25:16)
    at D:\Projects\projects\shoelace\node_modules\source-map\lib\source-map-consumer.js:264:14
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async D:\Projects\projects\shoelace\node_modules\@web\test-runner-core\dist\server\plugins\api\createSourceMapFunction.js:96:28
    at async mapStackLocation (D:\Projects\projects\shoelace\node_modules\@web\test-runner-core\dist\server\plugins\api\parseBrowserResult.js:8:27)
    at async formatLocation (D:\Projects\projects\shoelace\node_modules\@web\browser-logs\dist\parseStackTrace.js:65:26)
    at async Object.parseStackTrace (D:\Projects\projects\shoelace\node_modules\@web\browser-logs\dist\parseStackTrace.js:107:23)
    at async replaceErrorStack (D:\Projects\projects\shoelace\node_modules\@web\test-runner-core\dist\server\plugins\api\parseBrowserErrors.js:8:23)
    at async D:\Projects\projects\shoelace\node_modules\@web\test-runner-core\dist\server\plugins\api\parseBrowserErrors.js:39:17
src\components\input\input.test.ts:

 ❌ <sl-input> > value methods > should set the value as a date when using valueAsDate (failed on Webkit)
      InvalidStateError: The object is in an invalid state.
        at valueAsDate (dist\chunks\chunk.3NUIDU4I.js:77:10)
        at src\components\input\input.test.ts:54:9

src\components\menu\menu.test.ts:

 ❌ <sl-menu> > does not select disabled items (failed on Firefox)
      Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
        at createTimeoutError (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:242929)
        at Gg.prototype._timeoutError (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:258879)
        at Gg.prototype.resetTimeout/this.timer< (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:256951)
        at setTimeout handler*Gg.prototype.resetTimeout (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:256905)
        at Gg.prototype.run/< (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:258292)
        at Gg.prototype.run (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:258545)
        at ym.prototype.runTest (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:273274)
        at ym.prototype.runTests/a/< (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:274210)
        at i (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:272659)
        at ym.prototype.hooks/< (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:272730)
        at i (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:271488)
        at ym.prototype.hook/< (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:272544)
        at Yy (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:326430)
        at setTimeout handler*Fy.Runner.immediately (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:326520)
        at ym.prototype.hook (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:272519)
        at i (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:272665)
        at ym.prototype.hooks (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:272743)
        at ym.prototype.hookUp (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:272845)
        at ym.prototype.runTests/a/</< (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:274695)
        at a (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:257393)
        at Gg.prototype.run/< (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:258333)
        at promise callback*Gg.prototype.run/< (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:258309)
        at Gg.prototype.run (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:258545)
        at ym.prototype.runTest (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:273274)
        at ym.prototype.runTests/a/< (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:274210)
        at i (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:272659)
        at ym.prototype.hooks/< (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:272730)
        at i (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:271488)
        at ym.prototype.hook/< (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:272544)
        at Yy (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:326430)
        at setTimeout handler*Fy.Runner.immediately (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:326520)
        at ym.prototype.hook (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:272519)
        at i (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:272665)
        at ym.prototype.hooks (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:272743)
        at ym.prototype.hookUp (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:272845)
        at ym.prototype.runTests/a/</< (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:274695)
        at a (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:257393)
        at Gg.prototype.run/< (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:258333)
        at promise callback*Gg.prototype.run/< (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:258309)
        at Gg.prototype.run (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:258545)
        at ym.prototype.runTest (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:273274)
        at ym.prototype.runTests/a/< (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:274210)
        at i (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:272659)
        at ym.prototype.hooks/< (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:272730)
        at i (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:271488)
        at ym.prototype.hook/< (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:272544)
        at Yy (..\..\..\D:\Projects\projects\shoelace\node_modules\@web\test-runner-mocha\dist\autorun.js:1:326430)

Chromium: |██████████████████████████████| 100/100 test files | 1056 passed, 0 failed
Firefox:  |██████████████████████████████| 100/100 test files | 1054 passed, 2 failed
Webkit:   |██████████████████████████████| 100/100 test files | 1054 passed, 2 failed

Finished running tests in 101.2s with 4 failed tests.

@tao-cumplido tao-cumplido marked this pull request as ready for review November 23, 2022 14:08
@claviska
Copy link
Member

Thanks. I agree that they shouldn't be treated as leaf nodes.

Regarding the tests — I can repro this on my Windows machine so I'll take a look at that separately. Thanks for the heads up!

@claviska claviska merged commit f3e2737 into shoelace-style:next Nov 23, 2022
@tao-cumplido tao-cumplido deleted the lazy-tree-items-leaf-selection branch November 23, 2022 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lazy tree items are treated as leafs in trees with leaf selection
2 participants