@@ -7,12 +7,13 @@ import {
77 PlaywrightVisualRegressionTracker ,
88 PageTrackOptions ,
99 ElementHandleTrackOptions ,
10- } from "." ;
10+ } from "./index " ;
1111import { mocked } from "ts-jest/utils" ;
1212import { MaybeMocked } from "ts-jest/dist/utils/testing" ;
1313
1414jest . mock ( "@visual-regression-tracker/sdk-js" ) ;
1515
16+ let browserName = chromium . name ( ) ;
1617let browserType = chromium ;
1718let browser : Browser ;
1819let context : BrowserContext ;
@@ -44,11 +45,11 @@ afterAll(async () => {
4445
4546describe ( "playwright" , ( ) => {
4647 beforeEach ( ( ) => {
47- playwrightVrt = new PlaywrightVisualRegressionTracker ( browserType , config ) ;
48+ playwrightVrt = new PlaywrightVisualRegressionTracker ( browserName , config ) ;
4849 } ) ;
4950
5051 it ( "constructor" , async ( ) => {
51- expect ( playwrightVrt [ "browser" ] ) . toBe ( browserType . name ( ) ) ;
52+ expect ( playwrightVrt [ "browser" ] ) . toBe ( browserName ) ;
5253 expect ( VisualRegressionTracker ) . toHaveBeenCalledWith ( config ) ;
5354 } ) ;
5455
@@ -111,7 +112,7 @@ describe("playwright", () => {
111112 expect ( VisualRegressionTracker . prototype . track ) . toHaveBeenCalledWith ( {
112113 name : imageName ,
113114 imageBase64 : screenshot . toString ( "base64" ) ,
114- browser : browserType . name ( ) ,
115+ browser : browserName ,
115116 viewport : `1800x1600` ,
116117 os : trackOptions . agent ?. os ,
117118 device : trackOptions . agent ?. device ,
@@ -130,7 +131,7 @@ describe("playwright", () => {
130131 expect ( VisualRegressionTracker . prototype . track ) . toHaveBeenCalledWith ( {
131132 name : imageName ,
132133 imageBase64 : screenshot . toString ( "base64" ) ,
133- browser : browserType . name ( ) ,
134+ browser : browserName ,
134135 viewport : undefined ,
135136 os : undefined ,
136137 device : undefined ,
@@ -181,7 +182,7 @@ describe("playwright", () => {
181182 expect ( VisualRegressionTracker . prototype . track ) . toHaveBeenCalledWith ( {
182183 name : imageName ,
183184 imageBase64 : screenshot . toString ( "base64" ) ,
184- browser : browserType . name ( ) ,
185+ browser : browserName ,
185186 viewport : trackOptions . agent ?. viewport ,
186187 os : trackOptions . agent ?. os ,
187188 device : trackOptions . agent ?. device ,
@@ -205,7 +206,7 @@ describe("playwright", () => {
205206 expect ( VisualRegressionTracker . prototype . track ) . toHaveBeenCalledWith ( {
206207 name : imageName ,
207208 imageBase64 : screenshot . toString ( "base64" ) ,
208- browser : browserType . name ( ) ,
209+ browser : browserName ,
209210 viewport : undefined ,
210211 os : undefined ,
211212 device : undefined ,
0 commit comments