Fixed my own issue.
I created a computed property - isDesktop() - that returns “this.$q.platform.is.desktop”. Then within my test file, I dynamically updated the computed property that then allowed me to test the functionality.
I defined a factory function that is then called in beforeEach().
const factory = (computed = { }) => {
return shallowMount(App, {
computed
});
};
beforeEach(() => {
wrapper = factory();
});
For the test that requires the updated computer property, I then called the factory function and set the computed property value.
it(‘my amazing test’, () => {
wrapper = factory({
isDesktop: () => false
});
expect(addYourAssertionHere)
})