Skip to content

Commit

Permalink
Merge pull request #336 from dotsub/diego-VTMS-4169-highlight-chars-fix
Browse files Browse the repository at this point in the history
Characters exceeding max chars per line not being highlighted fix
  • Loading branch information
Xaes authored Oct 12, 2022
2 parents 1556e50 + 6390735 commit 761d517
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dotsub/vtms-subtitle-edit-ui",
"version": "2.24.6",
"version": "2.24.7",
"description": "",
"author": "Dotsub",
"license": "",
Expand Down
2 changes: 1 addition & 1 deletion src/subtitleEdit/cues/edit/CueExtraCharacters.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe("CueExtraCharacters", () => {
it("renders", () => {
// GIVEN
const expectedNode = mount(
<span className="text-danger">
<span className="text-red-primary">
<div className="text">sample text</div>
</span>
);
Expand Down
2 changes: 1 addition & 1 deletion src/subtitleEdit/cues/edit/CueExtraCharacters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface Props {
export const CueExtraCharacters = (props: Props): ReactElement | null => {
return (
<span
className="text-danger"
className="text-red-primary"
data-offset-key={props.offsetKey}
>
{props.children}
Expand Down
30 changes: 15 additions & 15 deletions src/subtitleEdit/cues/edit/CueTextEditor.fake.debounce.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1748,7 +1748,7 @@ describe("CueTextEditor", () => {
const editUuid = testingStore.getState().cues[0].editUuid;
const expectedContent = "<span data-offset-key=\"\">" +
"<span data-text=\"true\">some very long text sample ver</span></span>" +
"<span class=\"text-danger\" data-offset-key=\"\">" +
"<span class=\"text-red-primary\" data-offset-key=\"\">" +
"<span data-offset-key=\"\"><span data-text=\"true\">y long text sample</span></span>";

// WHEN
Expand Down Expand Up @@ -1783,12 +1783,12 @@ describe("CueTextEditor", () => {
const editUuid = testingStore.getState().cues[0].editUuid;
const expectedContent = "<span data-offset-key=\"\">" +
"<span data-text=\"true\">some very </span></span>" +
"<span class=\"text-danger\" data-offset-key=\"\">" +
"<span class=\"text-red-primary\" data-offset-key=\"\">" +
"<span data-offset-key=\"\">" +
"<span data-text=\"true\">long text</span></span></span>" +
"<span data-offset-key=\"\">" +
"<span data-text=\"true\">\nsample ver</span></span>" +
"<span class=\"text-danger\" data-offset-key=\"\">" +
"<span class=\"text-red-primary\" data-offset-key=\"\">" +
"<span data-offset-key=\"\">" +
"<span data-text=\"true\">y long text sample</span></span></span>";

Expand Down Expand Up @@ -1870,7 +1870,7 @@ describe("CueTextEditor", () => {
// THEN
expect(removeDraftJsDynamicValues(container.outerHTML)).toContain(expectedContent);
expect(removeDraftJsDynamicValues(container.outerHTML))
.not.toContain("<span class=\"text-danger\" data-offset-key=\"\">");
.not.toContain("<span class=\"text-red-primary\" data-offset-key=\"\">");
});

it("does not render with too long lines decorator with subtitle specs maxCharactersPerLine null", () => {
Expand Down Expand Up @@ -1905,7 +1905,7 @@ describe("CueTextEditor", () => {
// THEN
expect(removeDraftJsDynamicValues(container.outerHTML)).toContain(expectedContent);
expect(removeDraftJsDynamicValues(container.outerHTML))
.not.toContain("<span class=\"text-danger\" data-offset-key=\"\">");
.not.toContain("<span class=\"text-red-primary\" data-offset-key=\"\">");
});

it("does not render with too long lines decorator with subtitle specs maxCharactersPerLine 0", () => {
Expand Down Expand Up @@ -1940,7 +1940,7 @@ describe("CueTextEditor", () => {
// THEN
expect(removeDraftJsDynamicValues(container.outerHTML)).toContain(expectedContent);
expect(removeDraftJsDynamicValues(container.outerHTML))
.not.toContain("<span class=\"text-danger\" data-offset-key=\"\">");
.not.toContain("<span class=\"text-red-primary\" data-offset-key=\"\">");
});

it("renders with too long lines and spell check errors", () => {
Expand All @@ -1966,7 +1966,7 @@ describe("CueTextEditor", () => {
"<span data-offset-key=\"\">" +
"<span data-text=\"true\">verry</span></span></span>" +
"<span data-offset-key=\"\"><span data-text=\"true\"> long text sample ve</span></span>" +
"<span class=\"text-danger\" data-offset-key=\"\">" +
"<span class=\"text-red-primary\" data-offset-key=\"\">" +
"<span data-offset-key=\"\"><span data-text=\"true\">ry long text sample</span></span></span>";

// WHEN
Expand Down Expand Up @@ -2019,7 +2019,7 @@ describe("CueTextEditor", () => {
const editUuid = testingStore.getState().cues[0].editUuid;
const expectedContent = "<span data-offset-key=\"\">" +
"<span data-text=\"true\">some very long\ntext sample very long\n</span></span>" +
"<span class=\"text-danger\" data-offset-key=\"\">" +
"<span class=\"text-red-primary\" data-offset-key=\"\">" +
"<span data-offset-key=\"\"><span data-text=\"true\">text sample</span></span>";

// WHEN
Expand Down Expand Up @@ -2054,17 +2054,17 @@ describe("CueTextEditor", () => {
const editUuid = testingStore.getState().cues[0].editUuid;
const expectedContent = "<span data-offset-key=\"\">" +
"<span data-text=\"true\">some very </span></span>" +
"<span class=\"text-danger\" data-offset-key=\"\">" +
"<span class=\"text-red-primary\" data-offset-key=\"\">" +
"<span data-offset-key=\"\">" +
"<span data-text=\"true\">long text</span></span></span>" +
"<span data-offset-key=\"\">" +
"<span data-text=\"true\">\nsample ver</span></span>" +
"<span class=\"text-danger\" data-offset-key=\"\">" +
"<span class=\"text-red-primary\" data-offset-key=\"\">" +
"<span data-offset-key=\"\">" +
"<span data-text=\"true\">y long text</span></span></span>" +
"<span data-offset-key=\"\">" +
"<span data-text=\"true\">\n</span></span>" +
"<span class=\"text-danger\" data-offset-key=\"\">" +
"<span class=\"text-red-primary\" data-offset-key=\"\">" +
"<span data-offset-key=\"\">" +
"<span data-text=\"true\">sample</span></span></span>";

Expand Down Expand Up @@ -2146,7 +2146,7 @@ describe("CueTextEditor", () => {
// THEN
expect(removeDraftJsDynamicValues(container.outerHTML)).toContain(expectedContent);
expect(removeDraftJsDynamicValues(container.outerHTML))
.not.toContain("<span class=\"text-danger\" data-offset-key=\"\">");
.not.toContain("<span class=\"text-red-primary\" data-offset-key=\"\">");
});

it("does not render with too many lines decorator with subtitle specs maxLinesPerCaption null", () => {
Expand Down Expand Up @@ -2181,7 +2181,7 @@ describe("CueTextEditor", () => {
// THEN
expect(removeDraftJsDynamicValues(container.outerHTML)).toContain(expectedContent);
expect(removeDraftJsDynamicValues(container.outerHTML))
.not.toContain("<span class=\"text-danger\" data-offset-key=\"\">");
.not.toContain("<span class=\"text-red-primary\" data-offset-key=\"\">");
});

it("does not render with too many lines decorator with subtitle specs maxLinesPerCaption 0", () => {
Expand Down Expand Up @@ -2216,7 +2216,7 @@ describe("CueTextEditor", () => {
// THEN
expect(removeDraftJsDynamicValues(container.outerHTML)).toContain(expectedContent);
expect(removeDraftJsDynamicValues(container.outerHTML))
.not.toContain("<span class=\"text-danger\" data-offset-key=\"\">");
.not.toContain("<span class=\"text-red-primary\" data-offset-key=\"\">");
});

it("renders with too many lines and spell check errors", () => {
Expand All @@ -2242,7 +2242,7 @@ describe("CueTextEditor", () => {
"<span data-offset-key=\"\">" +
"<span data-text=\"true\">verry</span></span></span>" +
"<span data-offset-key=\"\"><span data-text=\"true\"> long\ntext sample very long\n</span></span>" +
"<span class=\"text-danger\" data-offset-key=\"\">" +
"<span class=\"text-red-primary\" data-offset-key=\"\">" +
"<span data-offset-key=\"\"><span data-text=\"true\">text sample</span></span></span>";

// WHEN
Expand Down

0 comments on commit 761d517

Please sign in to comment.