Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelchadwick committed May 24, 2024
1 parent c22105d commit 3b56950
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
16 changes: 15 additions & 1 deletion tests/acceptance/remember-stuff-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,28 @@ module('Acceptance | remember stuff', function (hooks) {
assert.strictEqual(currentURL(), '/about');
assert.dom('nav').exists();
assert.dom('h1').hasText('RemEmber Stuff');
assert.dom('h2').hasText('About');
assert.dom('h2').hasText('About the Site');
assert.dom('p').hasText('RemEmber Stuff is a web application I built to learn about EmberJS.');

await click('nav a h1');

assert.strictEqual(currentURL(), '/');
});

test('visiting /messages', async function (assert) {
await visit('/messages');

assert.strictEqual(currentURL(), '/messages');
assert.dom('nav').exists();
assert.dom('h1').hasText('RemEmber Stuff');
assert.dom('h2').hasText('Chat Messages');
assert.dom('div.messages').exists();

await click('nav a h1');

assert.strictEqual(currentURL(), '/');
});

test('visiting /links', async function (assert) {
await visit('/links');

Expand Down
10 changes: 9 additions & 1 deletion tests/integration/components/contact-form-test.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
import { module, test } from 'qunit';
import { setupIntl, setLocale } from 'ember-intl/test-support';
import { setupRenderingTest } from 'remember-stuff/tests/helpers';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';

module('Integration | Component | contact-form', function (hooks) {
setupRenderingTest(hooks);
setupIntl(hooks);

hooks.afterEach(() => {
setLocale('en-us');
});

test('it renders', async function (assert) {
await render(hbs`<Forms::ContactForm />`);

assert.dom('p').hasText('Want to say hello? Have a suggestion for this app? Drop me a line.');
assert.dom('.contact-form').exists();
assert
.dom('.contact-form p')
.hasText('Want to say hello? Have a suggestion for this app? Drop me a line.');
});
});
2 changes: 1 addition & 1 deletion translations/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ layout:
navLinks: Links
navMessages: Messages
navMusic: Music
headAbout: About The Site
headAbout: About the Site
headContact: Contact
headLinks: Related Links
headMessages: Chat Messages
Expand Down

0 comments on commit 3b56950

Please sign in to comment.