-
-
Notifications
You must be signed in to change notification settings - Fork 832
Add a basic E2E test for event tiles #10306
Add a basic E2E test for event tiles #10306
Conversation
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
cy.get(".mx_EventTile") | ||
.should("have.css", "max-width", "100%") | ||
.should("have.css", "clear", "both") | ||
.should("have.css", "position", "relative"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To confirm the declarations below (except padding and font size) are kept applied:
matrix-react-sdk/res/css/views/rooms/_EventTile.pcss
Lines 481 to 487 in 2344eaa
.mx_EventTile:not([data-layout="bubble"]) { | |
max-width: 100%; | |
clear: both; | |
padding-top: 18px; | |
font-size: $font-14px; | |
position: relative; | |
} |
.should("exist") | ||
.should("have.css", "max-width", "100%") | ||
.should("have.css", "clear", "both") | ||
.should("have.css", "position", "relative"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cy.get(".mx_EventTile") | ||
.should("have.css", "max-width", "none") | ||
.should("have.css", "clear", "both") | ||
.should("have.css", "position", "relative"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See:
matrix-react-sdk/res/css/views/rooms/_EventBubbleTile.pcss
Lines 42 to 52 in 2344eaa
.mx_EventTile[data-layout="bubble"] { | |
--EventTile_bubble_line-margin-inline-start: -9px; | |
--EventTile_bubble_line-margin-inline-end: -12px; | |
--EventTile_bubble_gap-inline: 5px; | |
position: relative; | |
/* Other half of the gutter is provided by margin-bottom on the last tile | |
of the section */ | |
margin-top: calc(var(--gutterSize) / 2); | |
margin-left: var(--EventTile_bubble-margin-inline-start); | |
font-size: $font-14px; |
Checking default values as well.
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
.should("have.css", "position", "relative"); | ||
|
||
// Check that block start padding of the second message is not overridden | ||
cy.get(".mx_EventTile.mx_EventTile_continuation").should("have.css", "margin-block-start", "2px"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See:
matrix-react-sdk/res/css/views/rooms/_EventTile.pcss
Lines 470 to 472 in 2344eaa
&.mx_EventTile_continuation { | |
margin-top: 2px; | |
} |
…odern layout Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
|
||
// Check mx_EventTile_continuation | ||
// Block start padding of the second message should not be overridden | ||
cy.get(".mx_EventTile_continuation").should("have.css", "padding-block-start", "0px"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
matrix-react-sdk/res/css/views/rooms/_EventTile.pcss
Lines 405 to 407 in 2344eaa
&.mx_EventTile_continuation { | |
padding-top: 0px !important; | |
} |
Ensuring zero block padding is applied without !important
flag.
|
||
// Check mx_EventTile_continuation | ||
// Block start padding of the second message should not be overridden | ||
cy.get(".mx_EventTile_continuation").should("have.css", "padding-block-start", "0px"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See:
padding-top: 0; |
cy.get(".mx_EventTile_line").should("have.css", "clear", "both"); | ||
}) | ||
// Check that zero block padding is set | ||
.should("have.css", "padding-block-start", "0px"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Check mx_EventTile_continuation | ||
// Block start padding of the second message should not be overridden | ||
cy.get(".mx_EventTile_continuation").should("have.css", "padding-block-start", "0px"); | ||
cy.get(".mx_EventTile_continuation .mx_EventTile_line").should("have.css", "clear", "both"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See:
matrix-react-sdk/res/css/views/rooms/_EventTile.pcss
Lines 239 to 241 in 2344eaa
&.mx_EventTile_continuation .mx_EventTile_line { | |
clear: both; | |
} |
// Check mx_EventTile_continuation | ||
// Block start padding of the second message should not be overridden | ||
cy.get(".mx_EventTile_continuation").should("have.css", "padding-block-start", "0px"); | ||
cy.get(".mx_EventTile_continuation .mx_EventTile_line").should("have.css", "clear", "both"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See:
matrix-react-sdk/res/css/views/rooms/_EventTile.pcss
Lines 239 to 241 in 2344eaa
&.mx_EventTile_continuation .mx_EventTile_line { | |
clear: both; | |
} |
cy.get(".mx_EventTile_last") | ||
.within(() => { | ||
// calc(var(--gutterSize) - 1px) | ||
cy.get(".mx_EventTile_line").should("have.css", "padding-block-start", "10px"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See:
matrix-react-sdk/res/css/views/rooms/_EventBubbleTile.pcss
Lines 345 to 349 in 2344eaa
&:not(.mx_EventTile_noBubble) .mx_EventTile_line:not(.mx_EventTile_mediaLine) { | |
/* make the top and bottom padding 1px smaller so that we can pad | |
.mx_EventTile_content by 1px */ | |
/* to avoid anti-zalgo cutting off our larger than text emojis. */ | |
padding: calc(var(--gutterSize) - 1px); |
This messy selector with the double negation should be simplified eventually.
// calc(var(--gutterSize) - 1px) | ||
cy.get(".mx_EventTile_line").should("have.css", "padding-block-start", "10px"); | ||
}) | ||
.should("have.css", "margin-block-start", "2px"); // The last bubble is also a continued one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the test @luixxiul
Thanks for the quick review! |
This PR intends to add E2E test to check
EventTile
s. Initially this test is to include a task to check declarations which are either difficult to detect with a screenshot test or specified with:not([data-layout=bubble])
pseudo class, in order to make sure that spacing value between continued event tiles is zero, before eventually removing this!important
flag, for example. Other test scenarios such as bubble of messages sent by other users, deleted messages, etc are to be implemented in future.Required for #9033
type: task
Signed-off-by: Suguru Hirahara luixxiul@users.noreply.github.com
Checklist
This change is marked as an internal change (Task), so will not be included in the changelog.