Skip to content

Commit

Permalink
Merge pull request #55 from gravity-ui/fix-close-hint-hook
Browse files Browse the repository at this point in the history
fix: dont close hint as user when run preset
  • Loading branch information
vanilla-wave authored Mar 4, 2024
2 parents eca2fc1 + ddebb48 commit 19f0c3d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
2 changes: 1 addition & 1 deletion src/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ export class Controller<HintParams, Presets extends string, Steps extends string
this.state.base.suggestedPresets.push(presetSlug);
}

await this.closeHintByUser();
await this.closeHint();

const actualPreset = this.options.config.presets[presetSlug] as CommonPreset<
HintParams,
Expand Down
12 changes: 0 additions & 12 deletions src/tests/commonPresets.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,6 @@ describe('preset management', function () {
await expect(options.showHint).toHaveBeenCalled();
});

it('run preset -> close current hint', async function () {
const controller = new Controller(getOptions());
await controller.stepElementReached({
stepSlug: 'createSprint',
element: getAnchorElement(),
});

await controller.runPreset('createQueue');

expect(controller.hintStore.state.open).toBe(false);
});

it('can run unavailable preset', async function () {
const controller = new Controller(options);
await controller.runPreset('createQueue');
Expand Down

0 comments on commit 19f0c3d

Please sign in to comment.