Skip to content

Commit

Permalink
remove descriptionHtml method from lambda steps
Browse files Browse the repository at this point in the history
  • Loading branch information
epszaw committed Aug 2, 2023
1 parent a3f2984 commit abd88f5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 37 deletions.
8 changes: 0 additions & 8 deletions packages/allure-js-commons/src/AllureCommandStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ export interface AllureCommandStep<T = MetadataMessage> {
): void | Promise<void>;

description(content: string): void | Promise<void>;

descriptionHtml(content: string): void | Promise<void>;
}

export class AllureCommandStepExecutable implements AllureCommandStep {
Expand Down Expand Up @@ -206,10 +204,6 @@ export class AllureCommandStepExecutable implements AllureCommandStep {
this.metadata.description = content;
}

descriptionHtml(content: string): void {
this.metadata.descriptionHtml = content;
}

async step(name: string, body: StepBodyFunction): Promise<void> {
if (!this.metadata.steps) {
this.metadata.steps = [];
Expand Down Expand Up @@ -257,7 +251,6 @@ export class AllureCommandStepExecutable implements AllureCommandStep {
parameters: [],
steps,
description,
descriptionHtml,
},
],
});
Expand All @@ -281,7 +274,6 @@ export class AllureCommandStepExecutable implements AllureCommandStep {
parameters: [],
steps,
description,
descriptionHtml,
},
],
});
Expand Down
38 changes: 9 additions & 29 deletions packages/allure-js-commons/test/specs/AllureCommandStep.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,40 +480,20 @@ describe("AllureCommandStep.start()", () => {
});

describe("description", () => {
describe("plain", () => {
let metadata: MetadataMessage;
let metadata: MetadataMessage;

beforeEach(async () => {
metadata = await currentStep.start((step) => {
step.description("foo");
});
});

it("doesn't provide description to metadata", () => {
expect(metadata.description).eq(undefined);
});

it("adds description to the step", () => {
expect(metadata.steps![0].description).eq("foo");
beforeEach(async () => {
metadata = await currentStep.start((step) => {
step.description("foo");
});
});

describe("html", () => {
let metadata: MetadataMessage;

beforeEach(async () => {
metadata = await currentStep.start((step) => {
step.descriptionHtml("foo");
});
});

it("doesn't provide html description to metadata", () => {
expect(metadata.descriptionHtml).eq(undefined);
});
it("doesn't provide description to metadata", () => {
expect(metadata.description).eq(undefined);
});

it("adds html description to the step", () => {
expect(metadata.steps![0].descriptionHtml).eq("foo");
});
it("adds description to the step", () => {
expect(metadata.steps![0].description).eq("foo");
});
});

Expand Down

0 comments on commit abd88f5

Please sign in to comment.