Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tolgee/ui

Package Overview
Dependencies
Maintainers
2
Versions
141
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tolgee/ui - npm Package Compare versions

Comparing version 4.9.0-rc.b7a4088.0 to 4.9.0

4

lib/KeyContextMenu/KeyContextMenu.js

@@ -119,4 +119,4 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {

}, key: index },
React.createElement(ScTranslation, null, _this.props.dependencies.translationService.getFromCacheOrFallback(key)),
React.createElement(ScKey, null, key))); })))));
React.createElement(ScTranslation, { "data-cy": "context-menu-value" }, _this.props.dependencies.translationService.getFromCacheOrFallback(key)),
React.createElement(ScKey, { "data-cy": "context-menu-key" }, key))); })))));
};

@@ -123,0 +123,0 @@ return KeyContextMenu;

{
"name": "@tolgee/ui",
"version": "4.9.0-rc.b7a4088.0",
"version": "4.9.0",
"description": "Translation mode UI for @tolgee/core package",

@@ -39,3 +39,3 @@ "main": "index.js",

"@testing-library/jest-dom": "^5.11.4",
"@tolgee/core": "^4.9.0-rc.b7a4088.0",
"@tolgee/core": "^4.8.6",
"@types/jest": "^27.0.2",

@@ -80,3 +80,3 @@ "@types/node": "^17.0.8",

"homepage": "https://github.com/tolgee/tolgee-js#readme",
"gitHead": "eb9351083de345c08157103aa758a8c6ef370d73",
"gitHead": "29b393bb1b97737b3d7e38017543450b2ae09908",
"publishConfig": {

@@ -83,0 +83,0 @@ "access": "public"

@@ -5,5 +5,9 @@ jest.autoMockOff();

import { UI } from '../index';
import { NodeHelper } from '@tolgee/core';
import { DEVTOOLS_ID } from '@tolgee/core';
import type { TranslationService } from '@tolgee/core/lib/services/TranslationService';
const getDevtoolsRoot = () => document.getElementById(DEVTOOLS_ID).shadowRoot;
const findByTestId = (testId: string) =>
Array.from(getDevtoolsRoot().querySelectorAll(`*[data-cy='${testId}']`));
test('it selects the key', (done) => {

@@ -45,12 +49,8 @@ const ui = new UI({

for (const key of keys) {
const element = NodeHelper.evaluateToSingle(
`//*[contains(text(), '${key}')]`,
document.body
);
// @ts-ignore
expect(element).toBeInTheDocument();
const elements = findByTestId('context-menu-key');
expect(elements.find((el) => el.textContent.includes(key))).not.toBeFalsy();
}
const translatedKeys = NodeHelper.evaluate(
`//*[contains(text(), 'Translated key')]`,
document.body
const translatedKeys = findByTestId('context-menu-value').filter(
(el) => el.textContent === 'Translated key'
);

@@ -60,7 +60,7 @@ expect(translatedKeys).toHaveLength(2);

// get key 2 and click it
const element = NodeHelper.evaluateToSingle(
`//*[contains(text(), 'key 2')]`,
document.body
const element = findByTestId('context-menu-key').find((el) =>
el.textContent.includes('key 2')
);
element.parentElement.click();
});

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc