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

chore: fix incorrect description of cy.clear command #29339

Merged

Conversation

nsbarsukov
Copy link
Contributor

return cy.now('type', $el, '{selectall}{del}', {


Create a simple component test:

import {Component} from '@angular/core';
import {mount} from 'cypress/angular';

@Component({
    standalone: true,
    template: `
        <input
            (beforeinput)="log('beforeinput', $event)"
            (input)="log('input', $event)"
        />
    `,
})
export class TestInput {
    protected log(eventName: string, event: any): void {
        console.log(`=[${eventName}]=`, {inputType: event.inputType});
    }
}

describe('Demonstration of incorrect documentation for cy.clear()', () => {
    it('Open dev tools and see console logs', () => {
        mount(TestInput);

        cy.get('input').type('1').clear();
    });
});

Run it and check console logs:

=[beforeinput]= {inputType: 'insertText'}
=[input]= {inputType: ''}
=[beforeinput]= {inputType: 'deleteContentForward'}
=[input]= {inputType: ''}

Backspace key produces deleteContentBackward (not forward!).

@CLAassistant
Copy link

CLAassistant commented Apr 16, 2024

CLA assistant check
All committers have signed the CLA.

@cypress-app-bot
Copy link
Collaborator

@nsbarsukov
Copy link
Contributor Author

@MikeMcC399
Copy link
Contributor

Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

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

@nsbarsukov I wonder how long this has been wrong. Thanks for noticing and correcting!

@jennifer-shehane jennifer-shehane merged commit ede4a6f into cypress-io:develop Apr 17, 2024
31 of 33 checks passed
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Apr 18, 2024

Released in 13.8.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v13.8.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Apr 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants