@@ -2,7 +2,7 @@ import { setActivePinia, createPinia } from "pinia";
22import { DOMWrapper , mount , VueWrapper } from "@vue/test-utils" ;
33import { createVuetify } from "vuetify" ;
44import MockAdapter from "axios-mock-adapter" ;
5- import { expect , describe , it , beforeEach , vi } from "vitest" ;
5+ import { expect , describe , it , beforeEach } from "vitest" ;
66import DeviceActionButton from "@/components/Devices/DeviceActionButton.vue" ;
77import { router } from "@/router" ;
88import { devicesApi } from "@/api/http" ;
@@ -95,14 +95,10 @@ describe("Device Action Button", () => {
9595 expect ( wrapper . vm . showDialog ) . toBe ( true ) ;
9696 } ) ;
9797
98- it ( "Closing dialog sets dialog value to false" , async ( ) => {
99- vi . spyOn ( console , "warn" ) . mockImplementation ( ( message ) => {
100- if ( message . includes ( "click:outside" ) ) return ;
101- console . log ( message ) ;
102- } ) ;
98+ it ( "Closing dialog sets showDialog value to false" , async ( ) => {
10399 wrapper . vm . showDialog = true ;
104- const dialogComponent = wrapper . findComponent ( { name : "VDialog " } ) ;
105- await dialogComponent . vm . $emit ( "click:outside " ) ;
100+ const dialogComponent = wrapper . findComponent ( { name : "BaseDialog " } ) ;
101+ await dialogComponent . vm . $emit ( "close " ) ;
106102 expect ( wrapper . vm . showDialog ) . toBe ( false ) ;
107103 } ) ;
108104
0 commit comments