Found font! Also tests and styling

This commit is contained in:
Melody Becker 2024-09-23 17:09:19 +02:00
parent 23aefa268a
commit 83b45a5e46
36 changed files with 616 additions and 415 deletions

View file

@ -1,21 +1,29 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'frontend-reactive/tests/helpers';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
import { module, test } from "qunit";
import { setupRenderingTest } from "frontend-reactive/tests/helpers";
import { render } from "@ember/test-helpers";
import { hbs } from "ember-cli-htmlbars";
module('Integration | Component | note', function (hooks) {
setupRenderingTest(hooks);
module("Integration | Component | note", function (hooks) {
setupRenderingTest(hooks);
test('it renders', async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
test("it renders", async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
this.set("note", {
displayname: "bob",
username: "alice",
server: "example.com",
content: "some content",
createdAt: Date.now(),
});
await render(hbs`
<Note @displayname="bob" @username="alice" @serverdomain="example.com" @content="some content"/>
await render(hbs`
<Note @note={{this.note}}/>
`);
assert.dom('p.note-user-displayname').hasText('bob');
assert.dom('p.note-user-handle').hasText('@alice@example.com');
assert.dom('p.note-content-text').hasText('some content');
});
assert.dom("p.note-user-displayname").hasText("bob");
assert.dom("p.note-user-handle").hasText("@alice@example.com");
assert.dom("p.note-content-text").hasText("some content");
// TODO: Fix tests
});
});

View file

@ -1,20 +1,41 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'frontend-reactive/tests/helpers';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
import { module, test } from "qunit";
import { setupRenderingTest } from "frontend-reactive/tests/helpers";
import { render, click } from "@ember/test-helpers";
import { hbs } from "ember-cli-htmlbars";
import { setupIntl } from "ember-intl/test-support";
module('Integration | Component | note/content', function (hooks) {
setupRenderingTest(hooks);
module("Integration | Component | note/content", function (hooks) {
setupRenderingTest(hooks);
setupIntl(hooks, "en-us");
test('note-content', async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
test("keep short content as is", async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
const shortContent = 'Lorem ipsum odor amet, consectetuer adipiscing elit.';
this.set('shortContent', shortContent);
const shortContent = "Lorem ipsum odor amet, consectetuer adipiscing elit.";
this.set("shortContent", shortContent);
await render(hbs`<Note::Content @content="{{this.shortContent}}"/>`);
await render(hbs`<Note::Content @content="{{this.shortContent}}"/>`);
assert.dom('.note-content-text').hasText(shortContent);
});
assert.dom(".note-content-text").hasText(shortContent);
});
test("long content cutoff and correct expansion", async function (assert) {
const longContent =
"Grapple keel reef fathom haul wind bilge rat swing the lead belay line pink. Man-of-war mizzenmast killick lookout yo-ho-ho Sail ho gabion careen sutler stern. Draught wherry lookout schooner prow hail-shot spanker Letter of Marque lateen sail strike colors.\n\nLad heave to topgallant scallywag scuppers Spanish Main poop deck spike hulk broadside. Snow take a caulk hornswaggle gaff swab quarter lugger spanker bilge provost. Man-of-war measured fer yer chains lugger cable loaded to the gunwalls prow piracy snow doubloon furl.\n\nDead men tell no tales jib chase guns gunwalls Gold Road smartly nipperkin topsail bilge water Pirate Round. Gaff gunwalls bilged on her anchor bilge water scourge of the seven seas parley ho sheet chase guns squiffy. Scuppers fathom ho quarter gally heave to yardarm coxswain red ensign pink.";
this.set("longContent", longContent);
await render(hbs`<Note::Content @content="{{this.longContent}}"/>`);
assert
.dom(".note-content-text")
.hasText(
"Grapple keel reef fathom haul wind bilge rat swing the lead belay line pink. Man-of-war mizzenmast killick lookout yo-ho-ho Sail ho gabion careen sutler stern. Draught wherry lookout schooner prow hail-shot ...",
);
assert.dom(".note-content-toggle").hasText("Expand");
await click(".note-content-toggle");
assert.dom(".note-content-toggle").hasText("Collapse");
assert.dom(".note-content-text").hasText(longContent);
});
});

View file

@ -1,26 +1,18 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'frontend-reactive/tests/helpers';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
import { module, test } from "qunit";
import { setupRenderingTest } from "frontend-reactive/tests/helpers";
import { render } from "@ember/test-helpers";
import { hbs } from "ember-cli-htmlbars";
module('Integration | Component | note/interactions', function (hooks) {
setupRenderingTest(hooks);
module("Integration | Component | note/interactions", function (hooks) {
setupRenderingTest(hooks);
test('it renders', async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
test("it renders", async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
await render(hbs`<Note::Interactions />`);
await render(hbs`<Note::Interactions />`);
assert.dom().hasText('');
// Template block usage:
await render(hbs`
<Note::Interactions>
template block text
</Note::Interactions>
`);
assert.dom().hasText('template block text');
});
assert.dom().hasText("");
// TODO: Add tests
});
});

View file

@ -1,20 +1,21 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'frontend-reactive/tests/helpers';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
import { module, test } from "qunit";
import { setupRenderingTest } from "frontend-reactive/tests/helpers";
import { render } from "@ember/test-helpers";
import { hbs } from "ember-cli-htmlbars";
module('Integration | Component | note/user-header', function (hooks) {
setupRenderingTest(hooks);
module("Integration | Component | note/user-header", function (hooks) {
setupRenderingTest(hooks);
test('it renders', async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
test("it renders", async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
await render(
hbs`<Note::UserHeader @displayname="bob" @handle="@alice@example.com"/>`,
);
await render(
hbs`<Note::UserHeader @displayname="bob" @handle="@alice@example.com"/>`,
);
assert.dom('p.note-user-displayname').hasText('bob');
assert.dom('p.note-user-handle').hasText('@alice@example.com');
});
assert.dom("p.note-user-displayname").hasText("bob");
assert.dom("p.note-user-handle").hasText("@alice@example.com");
// TODO: Expand tests to include profile picture
});
});

View file

@ -1,26 +1,18 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'frontend-reactive/tests/helpers';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
import { module, test } from "qunit";
import { setupRenderingTest } from "frontend-reactive/tests/helpers";
import { render } from "@ember/test-helpers";
import { hbs } from "ember-cli-htmlbars";
module('Integration | Component | page', function (hooks) {
setupRenderingTest(hooks);
module("Integration | Component | page", function (hooks) {
setupRenderingTest(hooks);
test('it renders', async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
test("it renders", async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
await render(hbs`<Page />`);
await render(hbs`<Page />`);
assert.dom().hasText('');
// Template block usage:
await render(hbs`
<Page>
template block text
</Page>
`);
assert.dom().hasText('template block text');
});
assert.dom().hasText("");
// TODO: Add tests
});
});

View file

@ -1,26 +1,18 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'frontend-reactive/tests/helpers';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
import { module, test } from "qunit";
import { setupRenderingTest } from "frontend-reactive/tests/helpers";
import { render } from "@ember/test-helpers";
import { hbs } from "ember-cli-htmlbars";
module('Integration | Component | page/header', function (hooks) {
setupRenderingTest(hooks);
module("Integration | Component | page/header", function (hooks) {
setupRenderingTest(hooks);
test('it renders', async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
test("it renders", async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
await render(hbs`<Page::Header />`);
await render(hbs`<Page::Header />`);
assert.dom().hasText('');
// Template block usage:
await render(hbs`
<Page::Header>
template block text
</Page::Header>
`);
assert.dom().hasText('template block text');
});
assert.dom().hasText("");
// TODO: Add tests
});
});

View file

@ -1,26 +1,18 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'frontend-reactive/tests/helpers';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
import { module, test } from "qunit";
import { setupRenderingTest } from "frontend-reactive/tests/helpers";
import { render } from "@ember/test-helpers";
import { hbs } from "ember-cli-htmlbars";
module('Integration | Component | page/left-sidebar', function (hooks) {
setupRenderingTest(hooks);
module("Integration | Component | page/left-sidebar", function (hooks) {
setupRenderingTest(hooks);
test('it renders', async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
test("it renders", async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
await render(hbs`<Page::LeftSidebar />`);
await render(hbs`<Page::LeftSidebar />`);
assert.dom().hasText('');
// Template block usage:
await render(hbs`
<Page::LeftSidebar>
template block text
</Page::LeftSidebar>
`);
assert.dom().hasText('template block text');
});
assert.dom().hasText("");
// TODO: Add tests
});
});

View file

@ -1,26 +0,0 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'frontend-reactive/tests/helpers';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
module('Integration | Component | svgs/heart-filled', function (hooks) {
setupRenderingTest(hooks);
test('it renders', async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
await render(hbs`<Svgs::HeartFilled />`);
assert.dom().hasText('');
// Template block usage:
await render(hbs`
<Svgs::HeartFilled>
template block text
</Svgs::HeartFilled>
`);
assert.dom().hasText('template block text');
});
});

View file

@ -1,26 +0,0 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'frontend-reactive/tests/helpers';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
module('Integration | Component | svgs/heart-outline', function (hooks) {
setupRenderingTest(hooks);
test('it renders', async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
await render(hbs`<Svgs::HeartOutline />`);
assert.dom().hasText('');
// Template block usage:
await render(hbs`
<Svgs::HeartOutline>
template block text
</Svgs::HeartOutline>
`);
assert.dom().hasText('template block text');
});
});

View file

@ -1,26 +0,0 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'frontend-reactive/tests/helpers';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
module('Integration | Component | svgs/reload-coloured', function (hooks) {
setupRenderingTest(hooks);
test('it renders', async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
await render(hbs`<Svgs::ReloadColoured />`);
assert.dom().hasText('');
// Template block usage:
await render(hbs`
<Svgs::ReloadColoured>
template block text
</Svgs::ReloadColoured>
`);
assert.dom().hasText('template block text');
});
});

View file

@ -1,26 +0,0 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'frontend-reactive/tests/helpers';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
module('Integration | Component | svgs/reload-outline', function (hooks) {
setupRenderingTest(hooks);
test('it renders', async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
await render(hbs`<Svgs::ReloadOutline />`);
assert.dom().hasText('');
// Template block usage:
await render(hbs`
<Svgs::ReloadOutline>
template block text
</Svgs::ReloadOutline>
`);
assert.dom().hasText('template block text');
});
});

View file

@ -1,26 +1,18 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'frontend-reactive/tests/helpers';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
import { module, test } from "qunit";
import { setupRenderingTest } from "frontend-reactive/tests/helpers";
import { render } from "@ember/test-helpers";
import { hbs } from "ember-cli-htmlbars";
module('Integration | Component | timeline', function (hooks) {
setupRenderingTest(hooks);
module("Integration | Component | timeline", function (hooks) {
setupRenderingTest(hooks);
test('it renders', async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
test("it renders", async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
await render(hbs`<Timeline />`);
await render(hbs`<Timeline />`);
assert.dom().hasText('');
// Template block usage:
await render(hbs`
<Timeline>
template block text
</Timeline>
`);
assert.dom().hasText('template block text');
});
assert.dom().hasText("");
// TODO: Add tests
});
});

View file

@ -1,26 +0,0 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'frontend-reactive/tests/helpers';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
module('Integration | Component | util/hover-info', function (hooks) {
setupRenderingTest(hooks);
test('it renders', async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
await render(hbs`<Util::HoverInfo />`);
assert.dom().hasText('');
// Template block usage:
await render(hbs`
<Util::HoverInfo>
template block text
</Util::HoverInfo>
`);
assert.dom().hasText('template block text');
});
});