Пример #1
0
test("can delete individual route visit", async function(assert) {
  const routeVisits = buildRouteVisitsWithSharedRoutePlan(1);

  mockFindAll("route-plan");
  mockQuery("route-visit").returns({json:routeVisits});

  await page.visit();
  assert.equal(page.routePlans(0).routeVisits().count, 1);

  mockUpdate("route-visit", 1);

  await page.routePlans(0).routeVisits(0).delete();

  assert.equal(page.routePlans(0).routeVisits().count, 0);
});
Пример #2
0
test("can delete route plans", async function(assert) {
  assert.expect(2);
  const routePlans = makeList("route-plan", 2);

  mockFindAll("route-plan").returns({models: routePlans});
  mockQuery("route-visit");

  await page.visit();
  assert.equal(page.routePlans().count, routePlans.length);

  mockDelete(routePlans.get("firstObject"));

  await page
    .routePlans(0)
    .openSettingMenu();

  await page.deleteRoutePlan();

  assert.equal(page.routePlans().count, (routePlans.length - 1));
});
Пример #3
0
test("can create new route plans", async function(assert) {
  mockFindAll("route-plan");
  mockFindAll("route-visit");
  mockCreate("route-plan")

  await page
    .visit()
    .createRoutePlan();

  assert.equal(page.routePlans().count, 1);
});
Пример #4
0
test("deleting handled route-visit moves it to open route-visit area", async function(assert) {
  const routeVisits = buildRouteVisitsWithSharedRoutePlan(1);

  mockFindAll("route-plan");
  mockQuery("route-visit").returns({json: routeVisits});
  mockUpdate("route-visit", 1);

  await page.visit();

  assert.equal(page.openRouteVisits().count, 0);

  await page.routePlans(0).routeVisits(0).delete();

  assert.equal(page.openRouteVisits().count, 1);
});