bulky-sundown-74498
04/09/2021, 7:06 PMsome-air-72294
04/09/2021, 7:16 PMrm -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 trackbulky-sundown-74498
04/09/2021, 7:16 PMbulky-sundown-74498
04/09/2021, 7:17 PMbulky-sundown-74498
04/09/2021, 7:17 PMbulky-sundown-74498
04/09/2021, 7:17 PMbulky-sundown-74498
04/09/2021, 7:17 PMbulky-sundown-74498
04/09/2021, 7:18 PMbulky-sundown-74498
04/09/2021, 7:18 PMsome-air-72294
04/09/2021, 7:18 PMbulky-sundown-74498
04/09/2021, 7:18 PMsome-air-72294
04/09/2021, 7:19 PMbulky-sundown-74498
04/09/2021, 7:20 PMsome-air-72294
04/09/2021, 7:20 PMsome-air-72294
04/09/2021, 7:21 PMbulky-sundown-74498
04/09/2021, 7:21 PMastonishing-football-22754
04/10/2021, 3:32 PMbulky-sundown-74498
04/10/2021, 3:32 PMastonishing-football-22754
04/10/2021, 3:36 PMmount
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
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');
});
});
bulky-sundown-74498
04/10/2021, 3:40 PMbulky-sundown-74498
04/10/2021, 3:42 PMCypress.vueWrapper
bulky-sundown-74498
04/10/2021, 3:45 PMbulky-sundown-74498
04/10/2021, 3:49 PMbulky-sundown-74498
04/10/2021, 3:49 PMastonishing-football-22754
04/10/2021, 3:58 PMbeforeEach
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.bulky-sundown-74498
04/10/2021, 4:07 PMbulky-sundown-74498
04/10/2021, 4:13 PMastonishing-football-22754
04/10/2021, 4:23 PMsetProps
there doesn't trigger changes on the mount
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
});
bulky-sundown-74498
04/10/2021, 4:24 PMbulky-sundown-74498
04/10/2021, 4:24 PM