From 44d1885ae95b4e47a0cea5c75512123efb674e22 Mon Sep 17 00:00:00 2001 From: Souma Ghosh <103924539+souma-ghosh@users.noreply.github.com> Date: Tue, 16 Aug 2022 11:12:31 +0530 Subject: [PATCH] fix: Text getting clipped for Italic font in Table Widget V1 (#15549) --- app/client/cypress/support/timeout.js | 90 +++++++++---------- .../component/AutoToolTipComponent.tsx | 1 + 2 files changed, 46 insertions(+), 45 deletions(-) diff --git a/app/client/cypress/support/timeout.js b/app/client/cypress/support/timeout.js index e1a7185403..230a203eb1 100644 --- a/app/client/cypress/support/timeout.js +++ b/app/client/cypress/support/timeout.js @@ -5,62 +5,62 @@ * Converts seconds to milliseconds * @param {number} n Seconds to convert */ - export const seconds = (n) => n * 1000 +export const seconds = (n) => n * 1000; - // keep an object with timers for tests where we set - // the timeout to avoid setting multiple timers - global.timers = new Map() +// keep an object with timers for tests where we set +// the timeout to avoid setting multiple timers +global.timers = new Map(); - /** - * Stops the current Cypress test if it takes longer than the provided timeout - * @param {number} ms Test timeout in milliseconds - * @example - * // stop and fail the test if it runs for longer than 10 seconds - * testTimeout(10 * 1000) - */ - export function testTimeout (ms) { - // get the current test reference using - // the cy.state() magic method - const currentTest = cy.state('runnable');// || test +/** + * Stops the current Cypress test if it takes longer than the provided timeout + * @param {number} ms Test timeout in milliseconds + * @example + * // stop and fail the test if it runs for longer than 10 seconds + * testTimeout(10 * 1000) + */ +export function testTimeout(ms) { + // get the current test reference using + // the cy.state() magic method + const currentTest = cy.state("runnable"); // || test - if (!currentTest) { - throw new Error('Could not determine current test') - } + if (!currentTest) { + throw new Error("Could not determine current test"); + } - if (global.timers.has(currentTest)) { - console.log('removing existing timer for test', currentTest) - clearTimeout(global.timers.get(currentTest)) - global.timers.delete(currentTest) - } + if (global.timers.has(currentTest)) { + console.log("removing existing timer for test", currentTest); + clearTimeout(global.timers.get(currentTest)); + global.timers.delete(currentTest); + } - const startedAt = +new Date() + const startedAt = +new Date(); - const timer = setTimeout(() => { - const testNow = cy.state('runnable') + const timer = setTimeout(() => { + const testNow = cy.state("runnable"); - console.log('test started', currentTest) - console.log('test now', testNow) + console.log("test started", currentTest); + console.log("test now", testNow); - if (currentTest !== testNow) { - // different test already - return - } + if (currentTest !== testNow) { + // different test already + return; + } - console.log('test now state', testNow.state) - if (testNow.state) { - // test has finished - return - } + console.log("test now state", testNow.state); + if (testNow.state) { + // test has finished + return; + } - const timeNow = +new Date() + const timeNow = +new Date(); - console.log('elapsed %d limit %d', timeNow - startedAt, ms) - if (timeNow - startedAt >= ms) { - throw new Error(`Test ran longer than ${ms}ms`) - } - }, ms) + console.log("elapsed %d limit %d", timeNow - startedAt, ms); + if (timeNow - startedAt >= ms) { + throw new Error(`Test ran longer than ${ms}ms`); + } + }, ms); - global.timers.set(currentTest, timer) - } + global.timers.set(currentTest, timer); +} //export default {testTimeout}; diff --git a/app/client/src/widgets/TableWidget/component/AutoToolTipComponent.tsx b/app/client/src/widgets/TableWidget/component/AutoToolTipComponent.tsx index b05f8cef38..5c6d74e263 100644 --- a/app/client/src/widgets/TableWidget/component/AutoToolTipComponent.tsx +++ b/app/client/src/widgets/TableWidget/component/AutoToolTipComponent.tsx @@ -21,6 +21,7 @@ export const OpenNewTabIconWrapper = styled.div` export const Content = styled.span` overflow: hidden; text-overflow: ellipsis; + padding-right: 4px; `; interface Props {