Skip to content

test(ui-truncate-text): migrate old TruncateText tests#1851

Merged
git-nandor merged 1 commit intomasterfrom
INSTUI-4427_convert_ui-truncate-text_to_the_new_test_format
Feb 5, 2025
Merged

test(ui-truncate-text): migrate old TruncateText tests#1851
git-nandor merged 1 commit intomasterfrom
INSTUI-4427_convert_ui-truncate-text_to_the_new_test_format

Conversation

@git-nandor
Copy link
Contributor

No description provided.

@git-nandor git-nandor requested review from ToMESSKa and balzss January 29, 2025 13:04
@git-nandor git-nandor self-assigned this Jan 29, 2025
@git-nandor git-nandor force-pushed the INSTUI-4427_convert_ui-truncate-text_to_the_new_test_format branch from c230996 to 29990d2 Compare January 29, 2025 13:38
@github-actions
Copy link

github-actions bot commented Jan 29, 2025

PR Preview Action v1.6.0
Preview removed because the pull request was closed.
2025-02-05 08:49 UTC


it('should preserve node structure', async () => {
cy.mount(
<div style={{ ...baseStyle, width: '200px' }} data-testid="container">
Copy link
Contributor

Choose a reason for hiding this comment

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

data-testid is not used anywhere, so it might be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

data-testid removed from where it was not used, and i also modified the style overwrite methods

expect(stage!.childNodes[1].nodeType).to.equal(1)
expect(stage!.childNodes[2].nodeType).to.equal(3)
expect(stage!.children.length).to.equal(2)
expect(stage!.nodeName).to.equal('P')
Copy link
Contributor

Choose a reason for hiding this comment

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

This p tag check is missing from the new test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the catch. P tag check added.

Comment on lines +47 to +49

cy.get('#stage').then(($stage) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Fontsize test might be needed too.

Copy link
Contributor

@balzss balzss Feb 3, 2025

Choose a reason for hiding this comment

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

not a bad idea but probably out of scope for this PR (unless there is an old fontsize test somewhere that I'm missing)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a new test case to check the effect of the font size

Copy link
Contributor

@balzss balzss left a comment

Choose a reason for hiding this comment

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

please check Tamas' comments, I've added my input there too. Otherwise looks good

@git-nandor git-nandor force-pushed the INSTUI-4427_convert_ui-truncate-text_to_the_new_test_format branch from 29990d2 to da63280 Compare February 4, 2025 21:22
@git-nandor git-nandor force-pushed the INSTUI-4427_convert_ui-truncate-text_to_the_new_test_format branch from da63280 to 546893f Compare February 4, 2025 21:28
@git-nandor git-nandor requested a review from ToMESSKa February 4, 2025 21:30
@git-nandor git-nandor merged commit 2787e07 into master Feb 5, 2025
10 of 11 checks passed
@git-nandor git-nandor deleted the INSTUI-4427_convert_ui-truncate-text_to_the_new_test_format branch February 5, 2025 08:49
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.

3 participants