summaryrefslogtreecommitdiff
path: root/app/domain/__tests__/user_spec.js
blob: dfe4d2649dad5f00e1ac8b6144fbb657cbb08e4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
class User {
  constructor(bodyWeight: 0) {
    this.bodyWeight = bodyWeight;
  }

  switchTo(program) { }

  nextWorkoutFor(routine) {
    return new Workout(this.bodyWeight);
  }
}

class StrongliftsProgram {
  routine(name) {
  }
}

class Workout {
  constructor(bodyWeight = 0) {
    this.bodyWeight = bodyWeight;
  }
}

describe("User", () => {
  it ("creates the next workout", function() {
    const program = new StrongliftsProgram();
    const user = new User(240);
    const routineA = program.routine("A")

    user.switchTo(program)
    const workout = user.nextWorkoutFor(routineA);

    expect(workout.bodyWeight).toEqual(240);
  });
});