late-waiter-93776
04/28/2022, 12:15 AMjavascript
import vuetify from "@/plugins/vuetify";
import { mount } from "@cypress/vue";
import Alert from "./Alert.vue";
import store from "@/store";
beforeEach(() => {
mount(Alert, {
extensions: {
use: [vuetify],
},
});
store.setAppAlertData({
title: "Test",
type: "success",
message: "Test should pass!",
});
});
describe("Alert", () => {
it("renders Alert", () => {
cy.get("[data-testid=Alert]").should("exist");
});
});
late-waiter-93776
04/28/2022, 12:19 AMbest-toothbrush-1100
04/28/2022, 2:07 PMlate-waiter-93776
04/28/2022, 4:30 PMlate-waiter-93776
05/03/2022, 1:29 AMvictorious-animal-96471
05/06/2022, 10:37 AMERROR in src/components/Campaigns/CampaignRow.cy.ts:5:9
TS2769: No overload matches this call.
The last overload gave the following error.
Argument of type 'CompatVue' is not assignable to parameter of type 'ComponentOptionsWithObjectProps<Readonly<ComponentPropsOptions<Data>>, unknown, unknown, {}, {}, Record<string, any>, ComponentOptionsMixin, ComponentOptionsMixin, string, Readonly<...> & { ...; }, { ...; } | {}>'.
Type 'CompatVue' is not assignable to type 'ComponentOptionsBase<Readonly<(readonly unknown[] & { [x: number]: string; } & { [iterator]?: IterableIterator<string> | undefined; map?: (<U>(callbackfn: (value: string, index: number, array: readonly string[]) => U, thisArg?: any) => U[]) | undefined; ... 21 more ...; toLocaleString?: string | undefined; }) | ({ ....'.
Types of property 'call' are incompatible.
Type '<T, A extends any[]>(this: new (...args: A) => T, thisArg: T, ...args: A) => void' is not assignable to type '(this: unknown, ...args: unknown[]) => never'.
The 'this' types of each signature are incompatible.
Type 'unknown' is not assignable to type 'new (...args: unknown[]) => unknown'.
3 |
4 | it('renders a campaign row', () => {
> 5 | mount(CampaignRow, {
| ^^^^^^^^^^^
6 | propsData: {
7 | campaign: {id:'someId', title: 'Test Campaign', owner: 'me', leadCount: 10},
8 | },
victorious-animal-96471
05/06/2022, 10:51 AMCannot read properties of undefined (reading 'emit')
early-toddler-97363
05/07/2022, 11:23 AMaloof-translator-20785
05/10/2022, 9:23 PMmagnificent-finland-58048
05/10/2022, 9:34 PMorange-baker-20977
05/11/2022, 12:51 PMwonderful-match-15836
05/11/2022, 1:00 PMwonderful-match-15836
05/11/2022, 2:23 PM@cypress/vue@2
early-toddler-97363
05/13/2022, 6:08 AMlate-waiter-93776
05/18/2022, 3:40 AMlate-waiter-93776
05/18/2022, 3:41 AMtypescript
it("resets to settings in store correctly", () => {
cy.get("[data-testid=generalSettingsModalActivator]").click();
cy.get("#listItemsTitle").type("{selectAll}").type("Items");
cy.get("#bannerColor").type("{selectAll}").type("#ff0000");
cy.get("#showHideSequenceNumbers")
.click()
// @ts-ignore
.vue()
.then((wrapper: any) => {
console.log(wrapper.propsData);
});
});
late-waiter-93776
05/18/2022, 3:42 AMconst state = reactive({...});
how can I access state from within my test?wonderful-match-15836
05/19/2022, 1:46 PMcalm-animal-12881
05/20/2022, 6:38 PMcalm-animal-12881
05/20/2022, 6:49 PMmagnificent-finland-58048
05/25/2022, 3:19 PMnpm run cypress open-ct
behave?calm-animal-12881
05/26/2022, 12:09 AMmagnificent-finland-58048
05/26/2022, 10:04 PMlittle-tiger-22751
05/27/2022, 7:26 PMdamp-kangaroo-1521
05/30/2022, 8:59 AMnutritious-glass-59704
06/08/2022, 3:20 PMnpm init vue@latest
and selecting cypress, typescript, and nothing else
I then created a cypress test for the included demo component WelcomeItem
I added one property.
The test is already failing with the message 'Cannot convert undefined or null to object'
The component works as expected in the app. It only fails in the test
Can someone please take a look at it? It is super simple.
https://github.com/jewpaltz/cypress_component_testing/commit/f4c1d34e1aa6fa1c2d4b63efec111728c3891317nutritious-glass-59704
06/09/2022, 7:13 AMlate-waiter-93776
06/13/2022, 10:24 PMpolite-france-34211
06/14/2022, 12:07 PMlate-waiter-93776
06/14/2022, 6:37 PMnpx cypress run-ct