0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

Fixed conflicting test selector in <GhTaskButton>

refs 8e120a74d6

- we use `data-test-state` inside of some modals which also use `<GhTaskButton>` which caused unrelated tests to start failing due to a change in matching element counts
This commit is contained in:
Kevin Ansfield 2022-04-19 20:42:47 +01:00
parent 8e120a74d6
commit f6c9ffcf60
2 changed files with 5 additions and 5 deletions

View file

@ -6,8 +6,8 @@
isFailure=this.isFailure isFailure=this.isFailure
)}} )}}
{{else}} {{else}}
{{#if this.isRunning}}<span data-test-state="running">{{svg-jar "spinner" class="gh-icon-spinner"}}{{this.runningText}}</span>{{/if}} {{#if this.isRunning}}<span data-test-task-button-state="running">{{svg-jar "spinner" class="gh-icon-spinner"}}{{this.runningText}}</span>{{/if}}
{{#if this.isIdle}}<span data-test-state="idle">{{this.buttonText}}</span>{{/if}} {{#if this.isIdle}}<span data-test-task-button-state="idle">{{this.buttonText}}</span>{{/if}}
{{#if this.isSuccess}}<span {{did-insert this.handleReset}} data-test-state="success">{{svg-jar "check-circle"}} {{this.successText}}</span>{{/if}} {{#if this.isSuccess}}<span {{did-insert this.handleReset}} data-test-task-button-state="success">{{svg-jar "check-circle"}} {{this.successText}}</span>{{/if}}
{{#if this.isFailure}}<span data-test-state="failure">{{svg-jar "retry"}} {{this.failureText}}</span>{{/if}} {{#if this.isFailure}}<span data-test-task-button-state="failure">{{svg-jar "retry"}} {{this.failureText}}</span>{{/if}}
{{/if}} {{/if}}

View file

@ -155,7 +155,7 @@ describe('Integration: Component: gh-task-button', function () {
await render(hbs`<GhTaskButton @task={{myTask}} />`); await render(hbs`<GhTaskButton @task={{myTask}} />`);
this.myTask.perform(); this.myTask.perform();
await waitFor('[data-test-state="idle"]', {timeout: 50}); await waitFor('[data-test-task-button-state="idle"]', {timeout: 50});
await settled(); await settled();
}); });