Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NetaMolcho committed Jan 25, 2024
1 parent 8d69e66 commit 0097ca7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/frontend/src/youi/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,10 @@ export default {
this.isReplaying = true;
this.numOfSteps = numOfSteps;
const answers = this.currentPrompt.answers;
if (this.backButtonText == "Back") {
if (
(this.backButtonText == "Back" && numOfSteps == 1) ||
(numOfSteps > 1 && this.promptIndex - numOfSteps > 0)
) {
return this.rpc.invoke("back", [
answers !== undefined ? JSON.parse(JSON.stringify(answers)) : answers,
numOfSteps,
Expand Down
2 changes: 2 additions & 0 deletions packages/frontend/test/App.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,7 @@ describe("App.vue", () => {
wrapper.vm.resolve = undefined;
wrapper.vm.promptIndex = 1;
wrapper.vm.prompts = [{}, {}];
wrapper.vm.selectGeneratorPromptExists = () => true;

wrapper.vm.back();

Expand Down Expand Up @@ -791,6 +792,7 @@ describe("App.vue", () => {
wrapper.vm.resolve = undefined;
wrapper.vm.promptIndex = 1;
wrapper.vm.prompts = [{}, {}];
wrapper.vm.selectGeneratorPromptExists = () => true;

wrapper.vm.gotoStep(1);

Expand Down

0 comments on commit 0097ca7

Please sign in to comment.