1
- import { StrokeColor } from '@blocksuite/affine-model' ;
2
1
import { expect } from '@playwright/test' ;
2
+ import { lightThemeV2 } from '@toeverything/theme/v2' ;
3
3
4
4
import {
5
5
assertEdgelessTool ,
@@ -80,15 +80,14 @@ test('add brush element with color', async ({ page }) => {
80
80
await switchEditorMode ( page ) ;
81
81
82
82
await setEdgelessTool ( page , 'brush' ) ;
83
- const color = StrokeColor . Blue ;
84
- await selectBrushColor ( page , color ) ;
83
+ await selectBrushColor ( page , 'Blue' ) ;
85
84
86
85
const start = { x : 100 , y : 100 } ;
87
86
const end = { x : 200 , y : 200 } ;
88
87
await dragBetweenCoords ( page , start , end , { steps : 100 } ) ;
89
88
90
89
const [ pickedColor ] = await pickColorAtPoints ( page , [ [ 110 , 110 ] ] ) ;
91
-
90
+ const color = lightThemeV2 [ 'edgeless/palette/medium/blueMedium' ] ;
92
91
await assertEdgelessColorSameWithHexColor ( page , color , pickedColor ) ;
93
92
} ) ;
94
93
@@ -101,8 +100,8 @@ test('keep same color when mouse mode switched back to brush', async ({
101
100
await deleteAll ( page ) ;
102
101
103
102
await setEdgelessTool ( page , 'brush' ) ;
104
- const color = StrokeColor . Blue ;
105
- await selectBrushColor ( page , color ) ;
103
+ await selectBrushColor ( page , ' Blue' ) ;
104
+
106
105
const start = { x : 200 , y : 200 } ;
107
106
const end = { x : 300 , y : 300 } ;
108
107
await dragBetweenCoords ( page , start , end , { steps : 100 } ) ;
@@ -113,7 +112,9 @@ test('keep same color when mouse mode switched back to brush', async ({
113
112
await setEdgelessTool ( page , 'brush' ) ;
114
113
const origin = { x : 100 , y : 100 } ;
115
114
await dragBetweenCoords ( page , origin , start , { steps : 100 } ) ;
115
+
116
116
const [ pickedColor ] = await pickColorAtPoints ( page , [ [ 110 , 110 ] ] ) ;
117
+ const color = lightThemeV2 [ 'edgeless/palette/medium/blueMedium' ] ;
117
118
await assertEdgelessColorSameWithHexColor ( page , color , pickedColor ) ;
118
119
} ) ;
119
120
@@ -124,8 +125,7 @@ test('add brush element with different size', async ({ page }) => {
124
125
125
126
await setEdgelessTool ( page , 'brush' ) ;
126
127
await selectBrushSize ( page , 'ten' ) ;
127
- const color = StrokeColor . Blue ;
128
- await selectBrushColor ( page , color ) ;
128
+ await selectBrushColor ( page , 'Blue' ) ;
129
129
130
130
const start = { x : 100 , y : 100 } ;
131
131
const end = { x : 200 , y : 100 } ;
@@ -143,6 +143,7 @@ test('add brush element with different size', async ({ page }) => {
143
143
[ 110 , 105 ] ,
144
144
] ) ;
145
145
146
+ const color = lightThemeV2 [ 'edgeless/palette/medium/blueMedium' ] ;
146
147
await assertEdgelessColorSameWithHexColor ( page , color , topEdge ) ;
147
148
await assertEdgelessColorSameWithHexColor ( page , color , bottomEdge ) ;
148
149
assertSameColor ( nearTopEdge , '#84cfff' ) ;
0 commit comments