1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- import { module, test } from 'qunit';
- import { click, visit, currentURL } from '@ember/test-helpers';
- import { setupApplicationTest } from 'ember-qunit';
-
- module('Acceptance | einkaufszettel', function(hooks) {
- setupApplicationTest(hooks);
-
- test('visiting /einkaufszettel', async function(assert) {
- await visit('/');
-
- assert.equal(currentURL(), '/');
- assert.dom('nav').exists();
- assert.dom('nav a.menu-index').hasText('EinkaufsZettel');
- assert.dom('nav a.menu-zettel').hasText('Zettel');
- assert.dom('nav a.menu-produkte').hasText('Produkte');
- assert.dom('nav a.menu-rezepte').hasText('Rezepte');
-
- });
-
- test('navigating using the nav-bar', async function(assert) {
- await visit('/');
-
- assert.dom('nav').exists();
- assert.dom('nav a.menu-index').hasText('EinkaufsZettel');
- assert.dom('nav a.menu-zettel').hasText('Zettel');
- assert.dom('nav a.menu-produkte').hasText('Produkte');
- assert.dom('nav a.menu-rezepte').hasText('Rezepte');
-
- await click('nav a.menu-zettel');
- assert.equal(currentURL(), '/zettel');
-
- await click('nav a.menu-produkte');
- assert.equal(currentURL(), '/produkte');
-
- await click('nav a.menu-rezepte');
- assert.equal(currentURL(), '/rezepte');
-
- await click('nav a.menu-index');
- assert.equal(currentURL(), '/');
- });
-
- test('visiting /zettel', async function(assert) {
- await visit('/zettel');
-
- assert.dom('nav').exists();
- assert.dom('nav a.menu-index').hasText('EinkaufsZettel');
- assert.dom('nav a.menu-zettel').hasText('Zettel');
- assert.dom('nav a.menu-produkte').hasText('Produkte');
- assert.dom('nav a.menu-rezepte').hasText('Rezepte');
-
- assert.dom('.jumbo h2').hasText('deine Zettel');
- assert.dom('.jumbo a.button').hasText('Zettel aktualisieren');
- await click('.jumbo a.button');
-
- assert.equal(currentURL(), '/zettel');
- });
-
- test('visiting /produkte', async function(assert) {
- await visit('/produkte');
-
- assert.dom('nav').exists();
- assert.dom('nav a.menu-index').hasText('EinkaufsZettel');
- assert.dom('nav a.menu-zettel').hasText('Zettel');
- assert.dom('nav a.menu-produkte').hasText('Produkte');
- assert.dom('nav a.menu-rezepte').hasText('Rezepte');
-
- assert.dom('.jumbo h2').hasText('deine Produkte');
- assert.dom('.jumbo a.button').hasText('Produkt hinzufügen');
- await click('.jumbo a.button');
-
- assert.equal(currentURL(), '/neues-produkt');
- });
-
- test('visiting /rezepte', async function(assert) {
- await visit('/rezepte');
-
- assert.dom('nav').exists();
- assert.dom('nav a.menu-index').hasText('EinkaufsZettel')
- assert.dom('nav a.menu-zettel').hasText('Zettel');
- assert.dom('nav a.menu-produkte').hasText('Produkte');
- assert.dom('nav a.menu-rezepte').hasText('Rezepte');
-
- assert.dom('.jumbo h2').hasText('deine Rezepte');
- assert.dom('.jumbo a.button').hasText('Rezepte bearbeiten');
- await click('.jumbo a.button');
-
- assert.equal(currentURL(), '/rezepte');
- });
-
-
-
- });
|