mirror of
https://github.com/discourse/discourse-table-builder.git
synced 2025-05-31 15:32:22 +00:00
DEV: Add acceptance tests
This commit is contained in:
parent
ccaa7b1d41
commit
34d1327951
@ -8,4 +8,4 @@ A theme component that adds a button to the composer tools to easily build table
|
|||||||
|
|
||||||
- [X] Add table builder functionality
|
- [X] Add table builder functionality
|
||||||
- [ ] Possibly add the ability to edit tables
|
- [ ] Possibly add the ability to edit tables
|
||||||
- [ ] Add front-end tests
|
- [X] Add front-end tests
|
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<DButton
|
<DButton
|
||||||
@class="btn-primary"
|
@class="btn-primary btn-build-table"
|
||||||
@label={{theme-prefix "discourse_table_builder.modal.create"}}
|
@label={{theme-prefix "discourse_table_builder.modal.create"}}
|
||||||
@icon="plus"
|
@icon="plus"
|
||||||
@action={{action "createTable"}}
|
@action={{action "createTable"}}
|
||||||
|
32
test/acceptance/table-builder.js
Normal file
32
test/acceptance/table-builder.js
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
import { acceptance, exists } from "discourse/tests/helpers/qunit-helpers";
|
||||||
|
import { click, visit } from "@ember/test-helpers";
|
||||||
|
import { test } from "qunit";
|
||||||
|
|
||||||
|
acceptance("Table Builder", function (needs) {
|
||||||
|
needs.user();
|
||||||
|
|
||||||
|
test("Can open table builder when creating a topic", async function (assert) {
|
||||||
|
await visit("/");
|
||||||
|
await click("#create-topic");
|
||||||
|
click(".table-builder");
|
||||||
|
assert.ok(exists(".table-builder-modal"));
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Can build table", async function (assert) {
|
||||||
|
await visit("/");
|
||||||
|
await click("#create-topic");
|
||||||
|
click(".btn-build-table");
|
||||||
|
assert.ok(exists(".d-editor-preview .md-table"));
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Can build table when editing post", async function (assert) {
|
||||||
|
await visit("/t/internationalization-localization/280");
|
||||||
|
await click("#post_1 .show-more-actions");
|
||||||
|
await click("#post_1 .edit");
|
||||||
|
assert.ok(exists("#reply-control"));
|
||||||
|
click(".table-builder");
|
||||||
|
assert.ok(exists(".table-builder-modal"));
|
||||||
|
click(".btn-build-table");
|
||||||
|
assert.ok(exists(".d-editor-preview .md-table"));
|
||||||
|
});
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user