@neo4j-cypher/react-codemirror 2.0.0-next.13 → 2.0.0-next.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,7 +21,9 @@ RETURN variable;`;
21
21
  ),
22
22
  );
23
23
  keywordcolors.every((kw) =>
24
- expect(kw).toEqual(lightThemeConstants.highlightStyles.keyword),
24
+ expect(kw).toEqual(
25
+ lightThemeConstants.highlightStyles.keyword.toLowerCase(),
26
+ ),
25
27
  );
26
28
 
27
29
  const labelReltype = await Promise.all(
@@ -30,34 +32,34 @@ RETURN variable;`;
30
32
  ),
31
33
  );
32
34
  labelReltype.every((kw) =>
33
- expect(kw).toEqual(lightThemeConstants.highlightStyles.label),
35
+ expect(kw).toEqual(lightThemeConstants.highlightStyles.label.toLowerCase()),
34
36
  );
35
37
 
36
38
  expect(
37
39
  await editorPage.getHexColorOfLocator(page.getByText('parameter')),
38
- ).toEqual(lightThemeConstants.highlightStyles.paramValue);
40
+ ).toEqual(lightThemeConstants.highlightStyles.paramValue.toLowerCase());
39
41
 
40
42
  expect(
41
43
  await editorPage.getHexColorOfLocator(page.getByText('property')),
42
- ).toEqual(lightThemeConstants.highlightStyles.property);
44
+ ).toEqual(lightThemeConstants.highlightStyles.property.toLowerCase());
43
45
 
44
46
  expect(
45
47
  await editorPage.getHexColorOfLocator(page.getByText('false')),
46
- ).toEqual(lightThemeConstants.highlightStyles.booleanLiteral);
48
+ ).toEqual(lightThemeConstants.highlightStyles.booleanLiteral.toLowerCase());
47
49
 
48
50
  expect(
49
51
  await editorPage.getHexColorOfLocator(page.getByText('String')),
50
- ).toEqual(lightThemeConstants.highlightStyles.stringLiteral);
52
+ ).toEqual(lightThemeConstants.highlightStyles.stringLiteral.toLowerCase());
51
53
 
52
54
  expect(
53
55
  await editorPage.getHexColorOfLocator(page.getByText('comment')),
54
- ).toEqual(lightThemeConstants.highlightStyles.comment);
56
+ ).toEqual(lightThemeConstants.highlightStyles.comment.toLowerCase());
55
57
 
56
58
  expect(
57
59
  await editorPage.getHexColorOfLocator(
58
60
  page.getByText('1234', { exact: true }),
59
61
  ),
60
- ).toEqual(lightThemeConstants.highlightStyles.numberLiteral);
62
+ ).toEqual(lightThemeConstants.highlightStyles.numberLiteral.toLowerCase());
61
63
 
62
64
  expect(await editorPage.editorBackgroundIsUnset()).toEqual(false);
63
65
  });
@@ -80,7 +82,9 @@ RETURN variable;`;
80
82
  ),
81
83
  );
82
84
  keywordcolors.every((kw) =>
83
- expect(kw).toEqual(darkThemeConstants.highlightStyles.keyword),
85
+ expect(kw).toEqual(
86
+ darkThemeConstants.highlightStyles.keyword.toLowerCase(),
87
+ ),
84
88
  );
85
89
 
86
90
  const labelReltype = await Promise.all(
@@ -89,34 +93,34 @@ RETURN variable;`;
89
93
  ),
90
94
  );
91
95
  labelReltype.every((kw) =>
92
- expect(kw).toEqual(darkThemeConstants.highlightStyles.label),
96
+ expect(kw).toEqual(darkThemeConstants.highlightStyles.label.toLowerCase()),
93
97
  );
94
98
 
95
99
  expect(
96
100
  await editorPage.getHexColorOfLocator(page.getByText('parameter')),
97
- ).toEqual(darkThemeConstants.highlightStyles.paramValue);
101
+ ).toEqual(darkThemeConstants.highlightStyles.paramValue.toLowerCase());
98
102
 
99
103
  expect(
100
104
  await editorPage.getHexColorOfLocator(page.getByText('property')),
101
- ).toEqual(darkThemeConstants.highlightStyles.property);
105
+ ).toEqual(darkThemeConstants.highlightStyles.property.toLowerCase());
102
106
 
103
107
  expect(
104
108
  await editorPage.getHexColorOfLocator(page.getByText('false')),
105
- ).toEqual(darkThemeConstants.highlightStyles.booleanLiteral);
109
+ ).toEqual(darkThemeConstants.highlightStyles.booleanLiteral.toLowerCase());
106
110
 
107
111
  expect(
108
112
  await editorPage.getHexColorOfLocator(page.getByText('String')),
109
- ).toEqual(darkThemeConstants.highlightStyles.stringLiteral);
113
+ ).toEqual(darkThemeConstants.highlightStyles.stringLiteral.toLowerCase());
110
114
 
111
115
  expect(
112
116
  await editorPage.getHexColorOfLocator(page.getByText('comment')),
113
- ).toEqual(darkThemeConstants.highlightStyles.comment);
117
+ ).toEqual(darkThemeConstants.highlightStyles.comment.toLowerCase());
114
118
 
115
119
  expect(
116
120
  await editorPage.getHexColorOfLocator(
117
121
  page.getByText('1234', { exact: true }),
118
122
  ),
119
- ).toEqual(darkThemeConstants.highlightStyles.numberLiteral);
123
+ ).toEqual(darkThemeConstants.highlightStyles.numberLiteral.toLowerCase());
120
124
 
121
125
  expect(await editorPage.editorBackgroundIsUnset()).toEqual(false);
122
126
  });
@@ -129,7 +133,7 @@ test('can live switch theme ', async ({ page, mount }) => {
129
133
  await editorPage.getHexColorOfLocator(
130
134
  page.getByText('RETURN', { exact: true }),
131
135
  ),
132
- ).toEqual(lightThemeConstants.highlightStyles.keyword);
136
+ ).toEqual(lightThemeConstants.highlightStyles.keyword.toLowerCase());
133
137
 
134
138
  await component.update(<CypherEditor theme="dark" value="RETURN" />);
135
139
 
@@ -137,7 +141,7 @@ test('can live switch theme ', async ({ page, mount }) => {
137
141
  await editorPage.getHexColorOfLocator(
138
142
  page.getByText('RETURN', { exact: true }),
139
143
  ),
140
- ).toEqual(darkThemeConstants.highlightStyles.keyword);
144
+ ).toEqual(darkThemeConstants.highlightStyles.keyword.toLowerCase());
141
145
  });
142
146
 
143
147
  test('respects prop to allow overriding bkg color', async ({ page, mount }) => {
@@ -162,7 +166,7 @@ multilinestring";`;
162
166
 
163
167
  expect(
164
168
  await editorPage.getHexColorOfLocator(page.getByText('multilinestring')),
165
- ).toEqual(lightThemeConstants.highlightStyles.stringLiteral);
169
+ ).toEqual(lightThemeConstants.highlightStyles.stringLiteral.toLowerCase());
166
170
  });
167
171
 
168
172
  test('highlights multiline label correctly', async ({ page, mount }) => {
@@ -177,7 +181,7 @@ Label\`)
177
181
 
178
182
  expect(
179
183
  await editorPage.getHexColorOfLocator(page.getByText('Label')),
180
- ).toEqual(lightThemeConstants.highlightStyles.label);
184
+ ).toEqual(lightThemeConstants.highlightStyles.label.toLowerCase());
181
185
  });
182
186
 
183
187
  test('highlights multiline comment correctly', async ({ page, mount }) => {
@@ -192,5 +196,5 @@ comment
192
196
 
193
197
  expect(
194
198
  await editorPage.getHexColorOfLocator(page.getByText('comment')),
195
- ).toEqual(lightThemeConstants.highlightStyles.comment);
199
+ ).toEqual(lightThemeConstants.highlightStyles.comment.toLowerCase());
196
200
  });
@@ -1,3 +1,4 @@
1
+ import { testData } from '@neo4j-cypher/language-support';
1
2
  import { expect, test } from '@playwright/experimental-ct-react';
2
3
  import { CypherEditor } from '../CypherEditor';
3
4
  import { CypherEditorPage } from './e2eUtils';
@@ -86,6 +87,20 @@ test('Errors for multiline undefined labels are highlighted correctly', async ({
86
87
  await editorPage.checkWarningMessage('Bar`', expectedMsg);
87
88
  });
88
89
 
90
+ test('Semantic errors work in firefox', async ({
91
+ browserName,
92
+ page,
93
+ mount,
94
+ }) => {
95
+ test.skip(browserName !== 'firefox');
96
+ const editorPage = new CypherEditorPage(page);
97
+ const query = 'MATCH (n:OperationalPoint)--(m:OperationalPoint) RETURN s,m,n';
98
+
99
+ await mount(<CypherEditor value={query} schema={testData.mockSchema} />);
100
+
101
+ await editorPage.checkErrorMessage('s,m,n', 'Variable `s` not defined');
102
+ });
103
+
89
104
  test('Semantic errors are surfaced when there are no syntactic errors', async ({
90
105
  page,
91
106
  mount,