Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
mkslanc committed May 23, 2023
1 parent 269d580 commit f553aed
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions packages/ace-linters/tests/unit/common-converters.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,6 @@ import {CommonConverter} from "../../type-converters/common-converters";


describe('General Converters', () => {
describe('normalizeRanges', () => {
it('should correctly normalize the ranges of an array of completions', () => {
const completions = [
{value: 'value1', range: {start: {row: 0, column: 0}, end: {row: 1, column: 0}}},
{value: 'value2', range: {start: {row: 2, column: 0}, end: {row: 3, column: 0}}}
];
const expected = [
{value: 'value1', range: AceRange.fromPoints({row: 0, column: 0}, {row: 1, column: 0})},
{value: 'value2', range: AceRange.fromPoints({row: 2, column: 0}, {row: 3, column: 0})}
];
expect(CommonConverter.normalizeRanges(completions)).to.deep.equal(expected);
});
});

describe('cleanHtml', () => {
it('should clean the HTML string by replacing <a> tags', () => {
const html = "<a href='www.example.com'>link</a>";
Expand All @@ -33,12 +19,12 @@ describe('General Converters', () => {
it('should correctly convert a range object to an Ace range', () => {
const range = {start: {row: 0, column: 0}, end: {row: 1, column: 0}};
const expected = AceRange.fromPoints({row: 0, column: 0}, {row: 1, column: 0});
expect(CommonConverter.toRange(range)).to.deep.equal(expected);
expect(CommonConverter.toRange(range, AceRange)).to.deep.equal(expected);
});

it('should return undefined if the range object is missing start or end properties', () => {
const range = {start: {row: 0, column: 0}};
expect(CommonConverter.toRange(range as any)).to.undefined;
expect(CommonConverter.toRange(range as any, AceRange)).to.undefined;
});
});

Expand Down

0 comments on commit f553aed

Please sign in to comment.