meta {
  name: Create heartbeats (alt 3)
  type: http
  seq: 4
}

post {
  url: {{BASE_URL}}/api/users/current/heartbeats.bulk
  body: json
  auth: bearer
}

auth:bearer {
  token: {{WRITEUSER_TOKEN}}
}

body:json {
  [{
      "entity": "/home/user1/dev/project1/main.go",
      "project": "wakapi",
      "language": "Go",
      "is_write": true,
      "type": "file",
      "category": null,
      "branch": null,
      "time": {{ts1}}
  },
  {
      "entity": "/home/user1/dev/project1/main.go",
      "project": "wakapi",
      "language": "Go",
      "is_write": true,
      "type": "file",
      "category": null,
      "branch": null,
      "time": {{ts2}}
  }]
}

assert {
  res.status: eq 201
}

tests {
  test("Response body is correct", function () {
      expect(res.body.responses.length).to.eql(2);
      expect(res.body.responses[0].length).to.eql(2);
      expect(res.body.responses[1].length).to.eql(2);
      expect(res.body.responses[0][1]).to.eql(201);
      expect(res.body.responses[1][1]).to.eql(201);
  });
}
