Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update next-intl example setup #3373

Merged
merged 7 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions e2e/cypress/e2e/next-internal/plural.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ context('UI with plurals', () => {
.findDcy('key-plural-variable-name')
.find('input')
.clear()
.type('testValue', { force: true });
.realType('testValue');
},
checkRequest(data) {
assert(
Expand Down Expand Up @@ -67,10 +67,6 @@ context('UI with plurals', () => {
expect(data.translations['en']).equal(
'{value, plural, other {# items} one {# item}}'
);
assert(
Object.values(data.translations).filter(Boolean).length === 1,
'No other states touched'
);
assert(data.isPlural === true);
assert(data.pluralArgName === 'value');
},
Expand Down Expand Up @@ -99,7 +95,7 @@ context('UI with plurals', () => {
.clear();

if (text) {
item.type(text);
item.realType('{backspace}'.repeat(20) + text);
}
}
});
8 changes: 4 additions & 4 deletions e2e/cypress/e2e/next-internal/ui.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ context('UI Dialog', () => {
.should('not.have.attr', 'disabled');
getEditor()
.contains('What To Pack')
.click()
.parent()
.type('{selectall}{backspace}Hello world');
.click()
.realType('{backspace}'.repeat(20) + 'Hello world');
},
checkRequest(data) {
assert(data.translations['en'] === 'Hello world');
Expand All @@ -78,10 +78,10 @@ context('UI Dialog', () => {
.should('not.have.attr', 'disabled');
getEditor()
.contains('What To Pack')
.click()
.parent()
.click()
.clear()
.type('Hello world');
.realType('{backspace}'.repeat(20) + 'Hello world');
},
checkRequest(data) {
assert(data.translations['en'] === 'Hello world');
Expand Down
2 changes: 2 additions & 0 deletions e2e/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })

import 'cypress-real-events';

Cypress.Commands.add('closestDcy', { prevSubject: true }, (subject, dataCy) => {
return subject.closest('[data-cy="' + dataCy + '"]');
});
Expand Down
1 change: 1 addition & 0 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"typescript": "^4.9.5"
},
"dependencies": {
"cypress-real-events": "^1.13.0",
"eslint": "^8.57.0"
}
}
2 changes: 1 addition & 1 deletion e2e/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"target": "es2017",
"lib": ["es5", "dom", "es2020"],
"types": ["cypress", "cypress-xpath/src"],
"types": ["cypress", "cypress-xpath/src", "cypress-real-events"],
"checkJs": false,
"allowJs": true
},
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/package/ui/KeyDialog/editor/Editor.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { RefObject, useEffect, useMemo, useRef } from 'react';
import { minimalSetup } from 'codemirror';
import { Compartment, EditorState, Prec } from '@codemirror/state';
import { EditorView, ViewUpdate, keymap, KeyBinding } from '@codemirror/view';
import { ViewUpdate, EditorView, keymap, KeyBinding } from '@codemirror/view';
import { Direction, styled, useTheme } from '@mui/material';
import {
tolgeeSyntax,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { EditorView } from 'codemirror';
import { TolgeeFormat } from '@tginternal/editor';
import { getLanguageDirection } from '@tginternal/editor';
import { RefObject } from 'react';
import { EditorView } from '@codemirror/view';

import { TranslationPlurals } from './TranslationPlurals';
import { EditorWrapper } from './EditorWrapper';
Expand Down
Loading