From de0ac154c78afcfcd2e37fffc3f3d8924b50098d Mon Sep 17 00:00:00 2001 From: Jai Bhagat Date: Wed, 5 Jan 2022 12:50:36 -0500 Subject: [PATCH] fix: no longer need gotoTaskGroup prop --- .../job-page/parts/task-groups-test.js | 43 +------------------ 1 file changed, 2 insertions(+), 41 deletions(-) diff --git a/ui/tests/integration/components/job-page/parts/task-groups-test.js b/ui/tests/integration/components/job-page/parts/task-groups-test.js index 0fa42ec1f..5d6836ec3 100644 --- a/ui/tests/integration/components/job-page/parts/task-groups-test.js +++ b/ui/tests/integration/components/job-page/parts/task-groups-test.js @@ -1,8 +1,7 @@ import { assign } from '@ember/polyfills'; import hbs from 'htmlbars-inline-precompile'; -import { click, findAll, find, render } from '@ember/test-helpers'; +import { findAll, find, render } from '@ember/test-helpers'; import { module, test } from 'qunit'; -import sinon from 'sinon'; import { startMirage } from 'nomad-ui/initializers/ember-cli-mirage'; import { setupRenderingTest } from 'ember-qunit'; import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; @@ -33,7 +32,6 @@ module( job, sortProperty: 'name', sortDescending: true, - gotoTaskGroup: () => {}, }, options ); @@ -57,7 +55,7 @@ module( @job={{this.job}} @sortProperty={{this.sortProperty}} @sortDescending={{this.sortDescending}} - @gotoTaskGroup={{this.gotoTaskGroup}} /> + /> `); assert.equal( @@ -88,7 +86,6 @@ module( @job={{this.job}} @sortProperty={{this.sortProperty}} @sortDescending={{this.sortDescending}} - @gotoTaskGroup={{this.gotoTaskGroup}} /> `); const taskGroupRow = find('[data-test-task-group]'); @@ -139,41 +136,5 @@ module( 'Reserved Disk' ); }); - - test('gotoTaskGroup is called when task group rows are clicked', async function (assert) { - this.server.create('job', { - createAllocations: false, - }); - - const job = await this.store.findAll('job').then(async (jobs) => { - return await jobs.get('firstObject').reload(); - }); - - const taskGroupSpy = sinon.spy(); - - const taskGroups = await job.get('taskGroups'); - const taskGroup = taskGroups.sortBy('name').reverse().get('firstObject'); - - this.setProperties( - props(job, { - gotoTaskGroup: taskGroupSpy, - }) - ); - - await render(hbs` - - `); - - await click('[data-test-task-group]'); - - assert.ok( - taskGroupSpy.withArgs(taskGroup).calledOnce, - 'Clicking the task group row calls the gotoTaskGroup action' - ); - }); } );