diff --git a/packages/frontend/app/components/learner-groups/loading.hbs b/packages/frontend/app/components/learner-groups/loading.hbs
new file mode 100644
index 0000000000..ecc1759b79
--- /dev/null
+++ b/packages/frontend/app/components/learner-groups/loading.hbs
@@ -0,0 +1,32 @@
+
+
+
+
+ {{t "general.learnerGroupTitle"}}
+ |
+
+ {{t "general.members"}}
+ |
+
+ {{t "general.subgroups"}}
+ |
+
+ {{t "general.actions"}}
+ |
+
+
+
+ {{! template-lint-disable no-unused-block-params }}
+ {{#each (repeat @count) as |empty|}}
+
+ {{truncate
+ (repeat (random 3 10) "ilios rocks")
+ 100
+ }} |
+ {{random 1 9}} |
+ {{random 1 9}} |
+ |
+
+ {{/each}}
+
+
\ No newline at end of file
diff --git a/packages/frontend/app/components/learner-groups/root.hbs b/packages/frontend/app/components/learner-groups/root.hbs
index 0f9a40e24a..c1f7a2c66c 100644
--- a/packages/frontend/app/components/learner-groups/root.hbs
+++ b/packages/frontend/app/components/learner-groups/root.hbs
@@ -122,7 +122,7 @@
@setSortBy={{@setSortBy}}
/>
{{else}}
-
+
{{/if}}
diff --git a/packages/frontend/app/styles/components.scss b/packages/frontend/app/styles/components.scss
index 0932bf3305..cae05daaa9 100644
--- a/packages/frontend/app/styles/components.scss
+++ b/packages/frontend/app/styles/components.scss
@@ -81,6 +81,7 @@
@import "components/learner-group/members";
@import "components/learner-groups/root";
+@import "components/learner-groups/loading";
@import "components/instructor-group/courses";
@import "components/instructor-group/header";
diff --git a/packages/frontend/app/styles/components/learner-groups/loading.scss b/packages/frontend/app/styles/components/learner-groups/loading.scss
new file mode 100644
index 0000000000..7bdf2c270e
--- /dev/null
+++ b/packages/frontend/app/styles/components/learner-groups/loading.scss
@@ -0,0 +1,5 @@
+@use "../../mixins" as m;
+
+.learner-groups-loading {
+ @include m.main-list-loading-table;
+}
diff --git a/packages/frontend/tests/acceptance/learnergroups-test.js b/packages/frontend/tests/acceptance/learnergroups-test.js
index 97e0bfe060..bdb92c68ba 100644
--- a/packages/frontend/tests/acceptance/learnergroups-test.js
+++ b/packages/frontend/tests/acceptance/learnergroups-test.js
@@ -16,11 +16,51 @@ module('Acceptance | Learner Groups', function (hooks) {
});
test('visiting /learnergroups', async function (assert) {
- assert.expect(1);
await page.visit();
assert.strictEqual(currentRouteName(), 'learner-groups');
});
+ test('list groups', async function (assert) {
+ assert.expect(8);
+ this.server.createList('user', 11);
+ const program = this.server.create('program', { school: this.school });
+ const programYear = this.server.create('program-year', { program });
+ const cohort = this.server.create('cohort', { programYear });
+ const firstLearnerGroup = this.server.create('learner-group', {
+ cohort,
+ userIds: [2, 3, 4, 5, 6],
+ });
+ this.server.create('learner-group', {
+ cohort,
+ });
+ const firstChildGroup = this.server.create('learner-group', {
+ parent: firstLearnerGroup,
+ userIds: [7, 8],
+ });
+ this.server.create('learner-group', {
+ parent: firstLearnerGroup,
+ userIds: [9, 10],
+ });
+ this.server.create('learner-group', {
+ parent: firstChildGroup,
+ userIds: [11, 12],
+ });
+ this.server.createList('offering', 2, {
+ learnerGroups: [firstLearnerGroup],
+ });
+
+ await page.visit();
+ await percySnapshot(assert);
+ assert.strictEqual(page.headerTitle, 'Learner Groups (2)');
+ assert.strictEqual(page.list.items.length, 2);
+ assert.strictEqual(page.list.items[0].title, 'learner group 0');
+ assert.strictEqual(page.list.items[0].users, '5');
+ assert.strictEqual(page.list.items[0].children, '2');
+ assert.strictEqual(page.list.items[1].title, 'learner group 1');
+ assert.strictEqual(page.list.items[1].users, '0');
+ assert.strictEqual(page.list.items[1].children, '0');
+ });
+
test('single option filters', async function (assert) {
assert.expect(6);
const program = this.server.create('program', { school: this.school });
@@ -93,47 +133,6 @@ module('Acceptance | Learner Groups', function (hooks) {
assert.strictEqual(page.list.items[0].title, 'learner group 1');
});
- test('list groups', async function (assert) {
- assert.expect(8);
- this.server.createList('user', 11);
- const program = this.server.create('program', { school: this.school });
- const programYear = this.server.create('program-year', { program });
- const cohort = this.server.create('cohort', { programYear });
- const firstLearnerGroup = this.server.create('learner-group', {
- cohort,
- userIds: [2, 3, 4, 5, 6],
- });
- this.server.create('learner-group', {
- cohort,
- });
- const firstChildGroup = this.server.create('learner-group', {
- parent: firstLearnerGroup,
- userIds: [7, 8],
- });
- this.server.create('learner-group', {
- parent: firstLearnerGroup,
- userIds: [9, 10],
- });
- this.server.create('learner-group', {
- parent: firstChildGroup,
- userIds: [11, 12],
- });
- this.server.createList('offering', 2, {
- learnerGroups: [firstLearnerGroup],
- });
-
- await page.visit();
- await percySnapshot(assert);
- assert.strictEqual(page.headerTitle, 'Learner Groups (2)');
- assert.strictEqual(page.list.items.length, 2);
- assert.strictEqual(page.list.items[0].title, 'learner group 0');
- assert.strictEqual(page.list.items[0].users, '5');
- assert.strictEqual(page.list.items[0].children, '2');
- assert.strictEqual(page.list.items[1].title, 'learner group 1');
- assert.strictEqual(page.list.items[1].users, '0');
- assert.strictEqual(page.list.items[1].children, '0');
- });
-
test('filters by title', async function (assert) {
const program = this.server.create('program', { school: this.school });
const programYear = this.server.create('program-year', { program });
diff --git a/packages/frontend/tests/integration/components/learner-groups/loading-test.js b/packages/frontend/tests/integration/components/learner-groups/loading-test.js
new file mode 100644
index 0000000000..416012d00b
--- /dev/null
+++ b/packages/frontend/tests/integration/components/learner-groups/loading-test.js
@@ -0,0 +1,17 @@
+import { module, test } from 'qunit';
+import { setupRenderingTest } from 'ember-qunit';
+import { setupIntl } from 'ember-intl/test-support';
+import { render } from '@ember/test-helpers';
+import { hbs } from 'ember-cli-htmlbars';
+import a11yAudit from 'ember-a11y-testing/test-support/audit';
+
+module('Integration | Component | learner-groups/loading', function (hooks) {
+ setupRenderingTest(hooks);
+ setupIntl(hooks, 'en-us');
+
+ test('it renders', async function (assert) {
+ await render(hbs``);
+ assert.dom('tbody tr').exists({ count: 2 });
+ await a11yAudit(this.element);
+ });
+});