Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Introduce sufficient models and factories to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
jgwhite committed May 20, 2021
1 parent 2b4dd76 commit 713b466
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 3 deletions.
7 changes: 7 additions & 0 deletions ui/mirage/factories/application.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Factory, trait } from 'ember-cli-mirage';

export default Factory.extend({
simple: trait({
name: 'simple-application',
}),
});
11 changes: 11 additions & 0 deletions ui/mirage/factories/project.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Factory, trait } from 'ember-cli-mirage';

export default Factory.extend({
simple: trait({
name: 'simple-project',
}),

'with-remote-runners': trait({
remoteEnabled: true,
}),
});
7 changes: 7 additions & 0 deletions ui/mirage/factories/workspace.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Factory, trait } from 'ember-cli-mirage';

export default Factory.extend({
default: trait({
name: 'default',
}),
});
5 changes: 5 additions & 0 deletions ui/mirage/models/application.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Model, belongsTo } from 'ember-cli-mirage';

export default Model.extend({
project: belongsTo(),
});
5 changes: 5 additions & 0 deletions ui/mirage/models/project.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Model, hasMany } from 'ember-cli-mirage';

export default Model.extend({
applications: hasMany(),
});
3 changes: 3 additions & 0 deletions ui/mirage/models/workspace.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { Model } from 'ember-cli-mirage';

export default Model.extend({});
7 changes: 4 additions & 3 deletions ui/tests/acceptance/up-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ module('Acceptance | up', function (hooks) {
test('happy path', async function (assert) {
// Given I have a project with remote runners enabled
let workspace = this.server.create('workspace', 'default');
let project = this.server.create('project', 'with-remote-runners');
let app = this.server.create('app', { project });
let project = this.server.create('project', 'simple', 'with-remote-runners');
let app = this.server.create('application', 'simple', { project });

// And I am viewing an app in that project
await visit(`/${workspace.name}/${project.name}/apps/${app.name}`);
await visit(`/${workspace.name}/${project.name}/app/${app.name}`);

assert.ok(find('main'));
// When I click “build, deploy & release”
Expand Down

0 comments on commit 713b466

Please sign in to comment.