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

test(karma-integration): migrate event tests to Karma #1114

Merged
merged 4 commits into from
Apr 9, 2019

Conversation

pmdartus
Copy link
Member

@pmdartus pmdartus commented Mar 15, 2019

Details

Add test related to events dispatching and propagation in simple shadow trees and nested shadow trees. Will add tests for slotted content in another PR.

Note: Most of the tests are related because of the following issues: #960, #1129, #1131, #1132, #1138, #1141

Does this PR introduce a breaking change?

  • Yes
  • No

@pmdartus pmdartus added the work-in-progress Work in progress label Mar 15, 2019
@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: db59b74 | Target commit: a2dfa8f

lwc-engine-benchmark

table-append-1k metric base(db59b74) target(a2dfa8f) trend
benchmark-table/append/1k duration 149.95 (±4.75 ms) 153.50 (±3.65 ms) +3.6ms (2.4%) 👎
table-clear-1k metric base(db59b74) target(a2dfa8f) trend
benchmark-table/clear/1k duration 10.50 (±0.60 ms) 10.20 (±0.60 ms) -0.3ms (2.9%) 👌
table-create-10k metric base(db59b74) target(a2dfa8f) trend
benchmark-table/create/10k duration 877.75 (±5.00 ms) 878.35 (±7.55 ms) +0.6ms (0.1%) 👌
table-create-1k metric base(db59b74) target(a2dfa8f) trend
benchmark-table/create/1k duration 117.75 (±3.20 ms) 117.85 (±2.90 ms) +0.1ms (0.1%) 👌
table-update-10th-1k metric base(db59b74) target(a2dfa8f) trend
benchmark-table/update-10th/1k duration 73.60 (±2.05 ms) 74.30 (±4.70 ms) +0.7ms (1.0%) 👌
tablecmp-append-1k metric base(db59b74) target(a2dfa8f) trend
benchmark-table-component/append/1k duration 221.65 (±9.60 ms) 226.75 (±9.95 ms) +5.1ms (2.3%) 👌
tablecmp-clear-1k metric base(db59b74) target(a2dfa8f) trend
benchmark-table-component/clear/1k duration 6.20 (±1.10 ms) 6.00 (±1.00 ms) -0.2ms (3.2%) 👌
tablecmp-create-10k metric base(db59b74) target(a2dfa8f) trend
benchmark-table-component/create/10k duration 1749.50 (±11.70 ms) 1766.25 (±11.40 ms) +16.8ms (1.0%) 👎
tablecmp-create-1k metric base(db59b74) target(a2dfa8f) trend
benchmark-table-component/create/1k duration 207.10 (±4.35 ms) 210.55 (±5.60 ms) +3.5ms (1.7%) 👌
tablecmp-update-10th-1k metric base(db59b74) target(a2dfa8f) trend
benchmark-table-component/update-10th/1k duration 68.70 (±4.55 ms) 69.05 (±6.25 ms) +0.4ms (0.5%) 👌
wc-append-1k metric base(db59b74) target(a2dfa8f) trend
benchmark-table-wc/append/1k duration 232.05 (±15.05 ms) 236.00 (±14.95 ms) +3.9ms (1.7%) 👌
wc-clear-1k metric base(db59b74) target(a2dfa8f) trend
benchmark-table-wc/clear/1k duration 10.75 (±1.30 ms) 10.75 (±1.85 ms) 0.0ms (0.0%) 👌
wc-create-10k metric base(db59b74) target(a2dfa8f) trend
benchmark-table-wc/create/10k duration 1838.70 (±12.45 ms) 1870.55 (±13.95 ms) +31.9ms (1.7%) 👎
wc-create-1k metric base(db59b74) target(a2dfa8f) trend
benchmark-table-wc/create/1k duration 218.25 (±4.95 ms) 218.65 (±4.75 ms) +0.4ms (0.2%) 👌
wc-update-10th-1k metric base(db59b74) target(a2dfa8f) trend
benchmark-table-wc/update-10th/1k duration 69.65 (±5.30 ms) 68.00 (±5.05 ms) -1.7ms (2.4%) 👌

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 1f12803 | Target commit: 30918bb

lwc-engine-benchmark

table-append-1k metric base(1f12803) target(30918bb) trend
benchmark-table/append/1k duration 151.55 (±6.15 ms) 151.75 (±4.75 ms) +0.2ms (0.1%) 👌
table-clear-1k metric base(1f12803) target(30918bb) trend
benchmark-table/clear/1k duration 10.35 (±0.75 ms) 10.90 (±0.85 ms) +0.5ms (5.3%) 👎
table-create-10k metric base(1f12803) target(30918bb) trend
benchmark-table/create/10k duration 877.20 (±6.25 ms) 885.45 (±6.15 ms) +8.3ms (0.9%) 👎
table-create-1k metric base(1f12803) target(30918bb) trend
benchmark-table/create/1k duration 116.65 (±2.15 ms) 117.90 (±3.55 ms) +1.3ms (1.1%) 👌
table-update-10th-1k metric base(1f12803) target(30918bb) trend
benchmark-table/update-10th/1k duration 73.30 (±2.40 ms) 84.30 (±2.80 ms) +11.0ms (15.0%) 👎
tablecmp-append-1k metric base(1f12803) target(30918bb) trend
benchmark-table-component/append/1k duration 222.05 (±8.85 ms) 223.30 (±12.35 ms) +1.3ms (0.6%) 👌
tablecmp-clear-1k metric base(1f12803) target(30918bb) trend
benchmark-table-component/clear/1k duration 5.80 (±0.90 ms) 6.20 (±1.20 ms) +0.4ms (6.9%) 👌
tablecmp-create-10k metric base(1f12803) target(30918bb) trend
benchmark-table-component/create/10k duration 1749.25 (±9.60 ms) 1767.60 (±12.00 ms) +18.3ms (1.0%) 👎
tablecmp-create-1k metric base(1f12803) target(30918bb) trend
benchmark-table-component/create/1k duration 211.20 (±4.45 ms) 207.75 (±5.75 ms) -3.4ms (1.6%) 👌
tablecmp-update-10th-1k metric base(1f12803) target(30918bb) trend
benchmark-table-component/update-10th/1k duration 66.45 (±4.70 ms) 68.05 (±4.55 ms) +1.6ms (2.4%) 👌
wc-append-1k metric base(1f12803) target(30918bb) trend
benchmark-table-wc/append/1k duration 237.00 (±16.00 ms) 229.85 (±14.25 ms) -7.2ms (3.0%) 👌
wc-clear-1k metric base(1f12803) target(30918bb) trend
benchmark-table-wc/clear/1k duration 10.45 (±1.80 ms) 10.55 (±1.50 ms) +0.1ms (1.0%) 👌
wc-create-10k metric base(1f12803) target(30918bb) trend
benchmark-table-wc/create/10k duration 1866.80 (±15.85 ms) 1886.50 (±17.95 ms) +19.7ms (1.1%) 👎
wc-create-1k metric base(1f12803) target(30918bb) trend
benchmark-table-wc/create/1k duration 224.50 (±6.95 ms) 214.35 (±5.25 ms) -10.2ms (4.5%) 👍
wc-update-10th-1k metric base(1f12803) target(30918bb) trend
benchmark-table-wc/update-10th/1k duration 70.90 (±5.65 ms) 68.60 (±4.50 ms) -2.3ms (3.2%) 👌

Copy link
Collaborator

@apapko apapko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for migrating these.

@pmdartus pmdartus force-pushed the pmdartus/migration-event-retragetting branch from 30918bb to 2405e30 Compare March 26, 2019 12:49
@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: b32da03 | Target commit: 2405e30

lwc-engine-benchmark

table-append-1k metric base(b32da03) target(2405e30) trend
benchmark-table/append/1k duration 151.45 (±5.35 ms) 152.25 (±5.15 ms) +0.8ms (0.5%) 👌
table-clear-1k metric base(b32da03) target(2405e30) trend
benchmark-table/clear/1k duration 10.60 (±0.60 ms) 10.45 (±0.85 ms) -0.2ms (1.4%) 👌
table-create-10k metric base(b32da03) target(2405e30) trend
benchmark-table/create/10k duration 897.10 (±8.20 ms) 889.50 (±7.50 ms) -7.6ms (0.8%) 👍
table-create-1k metric base(b32da03) target(2405e30) trend
benchmark-table/create/1k duration 120.60 (±2.50 ms) 118.55 (±2.95 ms) -2.0ms (1.7%) 👍
table-update-10th-1k metric base(b32da03) target(2405e30) trend
benchmark-table/update-10th/1k duration 75.40 (±3.10 ms) 73.65 (±1.40 ms) -1.8ms (2.3%) 👍
tablecmp-append-1k metric base(b32da03) target(2405e30) trend
benchmark-table-component/append/1k duration 224.40 (±8.30 ms) 227.05 (±12.65 ms) +2.7ms (1.2%) 👌
tablecmp-clear-1k metric base(b32da03) target(2405e30) trend
benchmark-table-component/clear/1k duration 5.60 (±0.80 ms) 5.90 (±0.90 ms) +0.3ms (5.4%) 👌
tablecmp-create-10k metric base(b32da03) target(2405e30) trend
benchmark-table-component/create/10k duration 1775.70 (±11.75 ms) 1737.10 (±11.25 ms) -38.6ms (2.2%) 👍
tablecmp-create-1k metric base(b32da03) target(2405e30) trend
benchmark-table-component/create/1k duration 209.35 (±5.30 ms) 209.60 (±6.15 ms) +0.3ms (0.1%) 👌
tablecmp-update-10th-1k metric base(b32da03) target(2405e30) trend
benchmark-table-component/update-10th/1k duration 69.05 (±4.85 ms) 68.70 (±4.45 ms) -0.4ms (0.5%) 👌
wc-append-1k metric base(b32da03) target(2405e30) trend
benchmark-table-wc/append/1k duration 231.90 (±16.00 ms) 229.05 (±15.65 ms) -2.8ms (1.2%) 👌
wc-clear-1k metric base(b32da03) target(2405e30) trend
benchmark-table-wc/clear/1k duration 10.65 (±1.55 ms) 10.05 (±1.55 ms) -0.6ms (5.6%) 👌
wc-create-10k metric base(b32da03) target(2405e30) trend
benchmark-table-wc/create/10k duration 1872.40 (±14.30 ms) 1900.20 (±23.45 ms) +27.8ms (1.5%) 👎
wc-create-1k metric base(b32da03) target(2405e30) trend
benchmark-table-wc/create/1k duration 220.30 (±5.25 ms) 220.95 (±5.25 ms) +0.6ms (0.3%) 👌
wc-update-10th-1k metric base(b32da03) target(2405e30) trend
benchmark-table-wc/update-10th/1k duration 70.45 (±5.55 ms) 69.10 (±4.25 ms) -1.3ms (1.9%) 👌

@pmdartus pmdartus removed the work-in-progress Work in progress label Mar 26, 2019
@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: b32da03 | Target commit: d3ab07e

lwc-engine-benchmark

table-append-1k metric base(b32da03) target(d3ab07e) trend
benchmark-table/append/1k duration 151.45 (±5.35 ms) 152.65 (±4.55 ms) +1.2ms (0.8%) 👌
table-clear-1k metric base(b32da03) target(d3ab07e) trend
benchmark-table/clear/1k duration 10.60 (±0.60 ms) 10.60 (±0.70 ms) 0.0ms (0.0%) 👌
table-create-10k metric base(b32da03) target(d3ab07e) trend
benchmark-table/create/10k duration 897.10 (±8.20 ms) 893.35 (±5.05 ms) -3.8ms (0.4%) 👌
table-create-1k metric base(b32da03) target(d3ab07e) trend
benchmark-table/create/1k duration 120.60 (±2.50 ms) 118.60 (±2.55 ms) -2.0ms (1.7%) 👍
table-update-10th-1k metric base(b32da03) target(d3ab07e) trend
benchmark-table/update-10th/1k duration 75.40 (±3.10 ms) 73.60 (±1.85 ms) -1.8ms (2.4%) 👍
tablecmp-append-1k metric base(b32da03) target(d3ab07e) trend
benchmark-table-component/append/1k duration 224.40 (±8.30 ms) 229.80 (±10.25 ms) +5.4ms (2.4%) 👌
tablecmp-clear-1k metric base(b32da03) target(d3ab07e) trend
benchmark-table-component/clear/1k duration 5.60 (±0.80 ms) 6.15 (±1.15 ms) +0.6ms (9.8%) 👌
tablecmp-create-10k metric base(b32da03) target(d3ab07e) trend
benchmark-table-component/create/10k duration 1775.70 (±11.75 ms) 1761.30 (±10.75 ms) -14.4ms (0.8%) 👍
tablecmp-create-1k metric base(b32da03) target(d3ab07e) trend
benchmark-table-component/create/1k duration 209.35 (±5.30 ms) 210.30 (±6.05 ms) +0.9ms (0.5%) 👌
tablecmp-update-10th-1k metric base(b32da03) target(d3ab07e) trend
benchmark-table-component/update-10th/1k duration 69.05 (±4.85 ms) 67.80 (±4.80 ms) -1.3ms (1.8%) 👌
wc-append-1k metric base(b32da03) target(d3ab07e) trend
benchmark-table-wc/append/1k duration 231.90 (±16.00 ms) 229.85 (±17.40 ms) -2.1ms (0.9%) 👌
wc-clear-1k metric base(b32da03) target(d3ab07e) trend
benchmark-table-wc/clear/1k duration 10.65 (±1.55 ms) 10.40 (±1.85 ms) -0.2ms (2.3%) 👌
wc-create-10k metric base(b32da03) target(d3ab07e) trend
benchmark-table-wc/create/10k duration 1872.40 (±14.30 ms) 1895.15 (±17.90 ms) +22.8ms (1.2%) 👎
wc-create-1k metric base(b32da03) target(d3ab07e) trend
benchmark-table-wc/create/1k duration 220.30 (±5.25 ms) 217.75 (±4.95 ms) -2.6ms (1.2%) 👍
wc-update-10th-1k metric base(b32da03) target(d3ab07e) trend
benchmark-table-wc/update-10th/1k duration 70.45 (±5.55 ms) 69.00 (±5.55 ms) -1.4ms (2.1%) 👌

function extractDataIds(root) {
var nodes = {};

function processElement(elm) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

processElement and acceptNode can be safely extracted outside of extractDataIds and reused.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code is wrapped into an iife, I think it makes more sense to keep all the code in there.

Copy link
Contributor

@ravijayaramappa ravijayaramappa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor optimizations, otherwise LGTM

test: add event propagation tests

test: add inside slot tests

test: event in shadow tree tests

wip: revert removed tests

wip: try to fix tests

chore: add test comments

chore: associated right bugs
@pmdartus pmdartus force-pushed the pmdartus/migration-event-retragetting branch from d3ab07e to 8cf6182 Compare April 9, 2019 12:06
@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: dbd1fec | Target commit: 9d70639

lwc-engine-benchmark

table-append-1k metric base(dbd1fec) target(9d70639) trend
benchmark-table/append/1k duration 152.00 (±4.95 ms) 153.65 (±2.55 ms) +1.6ms (1.1%) 👌
table-clear-1k metric base(dbd1fec) target(9d70639) trend
benchmark-table/clear/1k duration 10.60 (±0.70 ms) 10.90 (±0.60 ms) +0.3ms (2.8%) 👌
table-create-10k metric base(dbd1fec) target(9d70639) trend
benchmark-table/create/10k duration 897.00 (±6.50 ms) 887.15 (±6.50 ms) -9.9ms (1.1%) 👍
table-create-1k metric base(dbd1fec) target(9d70639) trend
benchmark-table/create/1k duration 116.35 (±2.75 ms) 118.00 (±3.20 ms) +1.7ms (1.4%) 👌
table-update-10th-1k metric base(dbd1fec) target(9d70639) trend
benchmark-table/update-10th/1k duration 71.40 (±3.45 ms) 79.80 (±4.15 ms) +8.4ms (11.8%) 👎
tablecmp-append-1k metric base(dbd1fec) target(9d70639) trend
benchmark-table-component/append/1k duration 225.10 (±8.85 ms) 230.60 (±11.30 ms) +5.5ms (2.4%) 👌
tablecmp-clear-1k metric base(dbd1fec) target(9d70639) trend
benchmark-table-component/clear/1k duration 6.55 (±0.95 ms) 6.55 (±1.05 ms) 0.0ms (0.0%) 👌
tablecmp-create-10k metric base(dbd1fec) target(9d70639) trend
benchmark-table-component/create/10k duration 1714.80 (±16.20 ms) 1735.15 (±13.85 ms) +20.4ms (1.2%) 👎
tablecmp-create-1k metric base(dbd1fec) target(9d70639) trend
benchmark-table-component/create/1k duration 207.60 (±4.85 ms) 210.00 (±5.75 ms) +2.4ms (1.2%) 👌
tablecmp-update-10th-1k metric base(dbd1fec) target(9d70639) trend
benchmark-table-component/update-10th/1k duration 67.80 (±5.15 ms) 68.40 (±4.00 ms) +0.6ms (0.9%) 👌
wc-append-1k metric base(dbd1fec) target(9d70639) trend
benchmark-table-wc/append/1k duration 227.60 (±16.65 ms) 232.95 (±20.80 ms) +5.3ms (2.4%) 👌
wc-clear-1k metric base(dbd1fec) target(9d70639) trend
benchmark-table-wc/clear/1k duration 10.95 (±1.50 ms) 11.25 (±1.70 ms) +0.3ms (2.7%) 👌
wc-create-10k metric base(dbd1fec) target(9d70639) trend
benchmark-table-wc/create/10k duration 1866.05 (±17.00 ms) 1852.00 (±18.30 ms) -14.0ms (0.8%) 👌
wc-create-1k metric base(dbd1fec) target(9d70639) trend
benchmark-table-wc/create/1k duration 216.40 (±5.65 ms) 216.80 (±5.50 ms) +0.4ms (0.2%) 👌
wc-update-10th-1k metric base(dbd1fec) target(9d70639) trend
benchmark-table-wc/update-10th/1k duration 72.50 (±5.20 ms) 69.65 (±4.75 ms) -2.8ms (3.9%) 👌

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.

None yet

3 participants