You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

einkaufszettel-test.js 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import { module, test } from 'qunit';
  2. import { click, visit, currentURL } from '@ember/test-helpers';
  3. import { setupApplicationTest } from 'ember-qunit';
  4. module('Acceptance | einkaufszettel', function(hooks) {
  5. setupApplicationTest(hooks);
  6. test('visiting /einkaufszettel', async function(assert) {
  7. await visit('/');
  8. assert.equal(currentURL(), '/');
  9. assert.dom('nav').exists();
  10. assert.dom('nav a.menu-index').hasText('EinkaufsZettel')
  11. assert.dom('nav a.menu-zettel').hasText('Zettel');
  12. assert.dom('nav a.menu-produkte').hasText('Produkte');
  13. assert.dom('nav a.menu-rezepte').hasText('Rezepte');
  14. });
  15. test('navigating using the nav-bar', async function(assert) {
  16. await visit('/');
  17. assert.dom('nav').exists();
  18. assert.dom('nav a.menu-index').hasText('EinkaufsZettel')
  19. assert.dom('nav a.menu-zettel').hasText('Zettel');
  20. assert.dom('nav a.menu-produkte').hasText('Produkte');
  21. assert.dom('nav a.menu-rezepte').hasText('Rezepte');
  22. await click('nav a.menu-zettel');
  23. assert.equal(currentURL(), '/zettel');
  24. await click('nav a.menu-produkte');
  25. assert.equal(currentURL(), '/produkte');
  26. await click('nav a.menu-rezepte');
  27. assert.equal(currentURL(), '/rezepte');
  28. await click('nav a.menu-index');
  29. assert.equal(currentURL(), '/');
  30. });
  31. test('visiting /zettel', async function(assert) {
  32. await visit('/zettel');
  33. assert.dom('nav').exists();
  34. assert.dom('nav a.menu-index').hasText('EinkaufsZettel')
  35. assert.dom('nav a.menu-zettel').hasText('Zettel');
  36. assert.dom('nav a.menu-produkte').hasText('Produkte');
  37. assert.dom('nav a.menu-rezepte').hasText('Rezepte');
  38. assert.dom('.jumbo a.h2').hasText('deine Zettel');
  39. assert.dom('.jumbo a.button').hasText('Zettel aktualisieren');
  40. await click('.jumbo a.button');
  41. assert.equal(currentURL(), '/zettel');
  42. });
  43. });