Skip to content

Commit

Permalink
Merge pull request #60 from gazedreamily/master
Browse files Browse the repository at this point in the history
test: add clear border info test case
  • Loading branch information
Qaplagzy authored Oct 13, 2022
2 parents 723c539 + 1336e81 commit 35cb031
Showing 1 changed file with 95 additions and 0 deletions.
95 changes: 95 additions & 0 deletions packages/core/test/toolbar/clear-format.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,64 @@ describe("clear format", () => {
},
],
],
config: {
borderInfo: [
{
rangeType: "range",
borderType: "border-all",
style: "3",
color: "#0000ff",
range: [
{
row: [0, 3],
column: [0, 2],
},
],
},
{
rangeType: "range",
borderType: "border-inside",
style: "3",
color: "#0000ff",
range: [
{
row: [7, 8],
column: [8, 9],
},
],
},
],
},
},
],
config: {
borderInfo: [
{
rangeType: "range",
borderType: "border-all",
style: "3",
color: "#0000ff",
range: [
{
row: [0, 3],
column: [0, 2],
},
],
},
{
rangeType: "range",
borderType: "border-inside",
style: "3",
color: "#0000ff",
range: [
{
row: [7, 8],
column: [8, 9],
},
],
},
],
},
});

test("clear format", async () => {
Expand All @@ -45,4 +101,43 @@ describe("clear format", () => {
};
expect(getFlowdata(ctx)[0][0]).toEqual(expectedCell);
});

test("clear border info", async () => {
const ctx = getContext();
const expectedBorderInfo = [
{
rangeType: "range",
borderType: "border-all",
style: "3",
color: "#0000ff",
range: [
{
row: [0, 3],
column: [0, 2],
},
],
},
{
rangeType: "range",
borderType: "border-inside",
style: "3",
color: "#0000ff",
range: [
{
row: [7, 8],
column: [8, 9],
},
],
},
{
rangeType: "range",
borderType: "border-none",
color: "#000000",
style: "1",
range: [{ row: [0, 0], column: [0, 0], row_focus: 0, column_focus: 0 }],
},
];
handleClearFormat(ctx);
expect(ctx.luckysheetfile[0].config.borderInfo).toEqual(expectedBorderInfo);
});
});

0 comments on commit 35cb031

Please sign in to comment.