1
1
import { makeDriverForTests , userEvent , render , screen } from "@component-test-utils" ;
2
2
import MasksView from "@/views/throughputreport/setup/MasksView.vue" ;
3
- import { describe , expect , test } from "vitest" ;
3
+ import { describe , expect , test , vi } from "vitest" ;
4
4
import * as precondition from "../../../../test/preconditions" ;
5
5
import { useServiceControl } from "@/composables/serviceServiceControl" ;
6
6
import { useServiceControlUrls } from "@/composables/serviceServiceControlUrls" ;
@@ -10,8 +10,6 @@ import Toast from "vue-toastification";
10
10
import { disableMonitoring } from "../../../../test/drivers/vitest/setup" ;
11
11
12
12
describe ( "MaskView tests" , ( ) => {
13
- const serviceControlInstanceUrl = window . defaultConfig . service_control_url ;
14
-
15
13
async function setup ( ) {
16
14
const driver = makeDriverForTests ( ) ;
17
15
@@ -27,7 +25,7 @@ describe("MaskView tests", () => {
27
25
28
26
async function renderComponent ( body : string [ ] = [ ] ) {
29
27
const driver = await setup ( ) ;
30
- driver . mockEndpoint ( `${ serviceControlInstanceUrl } licensing/settings/masks` , { body } ) ;
28
+ driver . mockEndpoint ( `${ window . defaultConfig . service_control_url } licensing/settings/masks` , { body } ) ;
31
29
useServiceControlUrls ( ) ;
32
30
await useServiceControl ( ) ;
33
31
const { debug } = render ( MasksView , { global : { plugins : [ Toast ] } } ) ;
@@ -66,7 +64,7 @@ describe("MaskView tests", () => {
66
64
const use = userEvent . setup ( ) ;
67
65
await use . type ( getTextAreaElement ( ) , "\nthree\nfour\nfive" ) ;
68
66
69
- driver . mockEndpoint ( `${ serviceControlInstanceUrl } licensing/settings/masks/update` , { body : undefined , method : "post" } ) ;
67
+ driver . mockEndpoint ( `${ window . defaultConfig . service_control_url } licensing/settings/masks/update` , { body : undefined , method : "post" } ) ;
70
68
await use . click ( screen . getByRole ( "button" , { name : / S a v e / i } ) ) ;
71
69
72
70
expect ( screen . queryAllByText ( / M a s k s S a v e d / i) . length ) . toBeGreaterThanOrEqual ( 1 ) ;
0 commit comments