https://cypress.io logo
Join Discord
Powered by
# vue
  • b

    bulky-sundown-74498

    04/09/2021, 7:06 PM
    Can't wait to see what you come up with 😉
  • s

    some-air-72294

    04/09/2021, 7:16 PM
    I tried quitting all chrome tabs and windows and retrying, same issue starting at 18/62. I even tried the following:
    Copy code
    rm -rf ~/Library/Caches/Cypress
    rm -rf node_modules
    npm install
    I was pretty confident the above would do it but it didn't. I'm going to try to try some other things before I try clearing all chrome cookies and history. I will update when i'm back on track
  • b

    bulky-sundown-74498

    04/09/2021, 7:16 PM
    Open the activity monitor
  • b

    bulky-sundown-74498

    04/09/2021, 7:17 PM
    there is a chrome process hanging somewhere
  • b

    bulky-sundown-74498

    04/09/2021, 7:17 PM
    closing all tabs is not enough
  • b

    bulky-sundown-74498

    04/09/2021, 7:17 PM
    chrome is a google software it does not want to be quit ever
  • b

    bulky-sundown-74498

    04/09/2021, 7:17 PM
    ^^
  • b

    bulky-sundown-74498

    04/09/2021, 7:18 PM
    So you have to tell it explicitly to quit using ctrl-Q
  • b

    bulky-sundown-74498

    04/09/2021, 7:18 PM
    closing all tabs is not enough
  • s

    some-air-72294

    04/09/2021, 7:18 PM
    Yes, sorry i did Ctrl-Q
  • b

    bulky-sundown-74498

    04/09/2021, 7:18 PM
    And the activity monitor is still showing nothing ?
  • s

    some-air-72294

    04/09/2021, 7:19 PM
    Okay this is bazar...i was going to take a video of before/after, and when i went to run it for the before video, its working?
  • b

    bulky-sundown-74498

    04/09/2021, 7:20 PM
    Yeah, we really need to get a hang of those orphans chrome instances
  • s

    some-air-72294

    04/09/2021, 7:20 PM
    it's like the maintainability gods are playing games with me....so disappointed in my mission to get us on track to a maintainable front-end lol
  • s

    some-air-72294

    04/09/2021, 7:21 PM
    Thanks again for your help, i will push the changes for getting this working now.
  • b

    bulky-sundown-74498

    04/09/2021, 7:21 PM
    no worries
  • a

    astonishing-football-22754

    04/10/2021, 3:32 PM
    Hey there, first of all. Kudos to the team for the awesome v7 release and the Component Test Runner 👏 , I'm playing around with it this weekend.
  • b

    bulky-sundown-74498

    04/10/2021, 3:32 PM
    Can't wait to see what you make !!... and what you think of it
  • a

    astonishing-football-22754

    04/10/2021, 3:36 PM
    I have a question that pop out, from what I read
    mount
    function is similar to the one used on Vue Test Utils, but isn't exactly the same right? I'm trying to setProps to the wrapper but got an error
    cmp.setProps is not a function
    Copy code
    describe('AsButton', () => {
      let cmp;
      beforeEach(() => {
        cmp = mount(AsButton, {
          propsData: {
            type: btnType.PRIMARY,
            label: `I'm a sexy button`,
          },
        });
      });
      it('renders a secodary button', () => {
        cmp.setProps({
          type: btnType.SECONDARY,
        });
    
        cy.get('button').should('have.class', 'btn-secondary');
      });
    });
  • b

    bulky-sundown-74498

    04/10/2021, 3:40 PM
    In short (and this in not obvious) the cypress mount function calls the mount from VTU but does not return the same object
  • b

    bulky-sundown-74498

    04/10/2021, 3:42 PM
    But you can still access the returned value of mount in
    Cypress.vueWrapper
  • b

    bulky-sundown-74498

    04/10/2021, 3:45 PM
    We are working an rerender function on the same idea as testing library that would allow you to do that
  • b

    bulky-sundown-74498

    04/10/2021, 3:49 PM
    Just curious though: - Why do you use setProps instead of another mount? The second mount would probably be safer since you get a fresh instance to test with. - Why test that a class is actually rendering? It feels like testing that vue actually works.
  • b

    bulky-sundown-74498

    04/10/2021, 3:49 PM
    Probably your tests are way more complicated
  • a

    astonishing-football-22754

    04/10/2021, 3:58 PM
    > Why do you use setProps instead of another mount? the
    beforeEach
    hook would create a new mount for each test with some default props, sometimes you want to test what happens on a component when a prop value updates. > Why test that a class is actually rendering? It feels like testing that vue actually works. Yep is just an example, as you say the proper tests are more complicated than that.
  • b

    bulky-sundown-74498

    04/10/2021, 4:07 PM
    Did the vueWrapper help you at all?
  • b

    bulky-sundown-74498

    04/10/2021, 4:13 PM
    I did not think of the default values scenario. Thanks for bringing it up!
  • a

    astonishing-football-22754

    04/10/2021, 4:23 PM
    I manage to access it, but calling the method
    setProps
    there doesn't trigger changes on the mount
    Copy code
    it('renders a primary button', () => {
          mount(AsButton, {
            propsData: {
              type: btnType.PRIMARY,
              label: `I'm a sexy button`,
            },
          });
    
          Cypress.vueWrapper.setProps({
            type: btnType.SECONDARY,
          });
    
          cy.wait(1000);
    
          cy.get('button').should('have.class', 'btn-secondary'); // Fails
        });
  • b

    bulky-sundown-74498

    04/10/2021, 4:24 PM
    🤔
  • b

    bulky-sundown-74498

    04/10/2021, 4:24 PM
    Vue 2 ?
1...101112...37Latest