Skip to content

Commit

Permalink
Change button class in Confirmation modal (#900)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-white committed Dec 5, 2023
1 parent c75d368 commit 82d668c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/components/confirmation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ except according to the terms contained in the LICENSE file.
<slot name="body"></slot>
</div>
<div class="modal-actions">
<button type="button" class="btn btn-danger"
<button type="button" class="btn btn-primary"
:aria-disabled="awaitingResponse" @click="$emit('success')">
{{ yesTextC }} <spinner :state="awaitingResponse"/>
</button>
Expand Down
8 changes: 4 additions & 4 deletions test/components/confirmation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('Confirmation', () => {
});

it('shows default text for yes button', () => {
const text = mountComponent().get('.btn-danger').text();
const text = mountComponent().get('.btn-primary').text();
text.should.equal('Yes');
});

Expand All @@ -33,7 +33,7 @@ describe('Confirmation', () => {
});

it('shows passed text for yes button', () => {
const text = mountComponent({ props: { yesText: 'Custom Yes Text' } }).get('.btn-danger').text();
const text = mountComponent({ props: { yesText: 'Custom Yes Text' } }).get('.btn-primary').text();
text.should.equal('Custom Yes Text');
});

Expand All @@ -50,12 +50,12 @@ describe('Confirmation', () => {

it('should disable all action buttons when awaitingResponse', async () => {
const component = mountComponent({ props: { awaitingResponse: true } });
assertStandardButton(component, '.btn-danger', ['.btn-link', '.close'], null, true);
assertStandardButton(component, '.btn-primary', ['.btn-link', '.close'], null, true);
});

it('should emit success on yes button', async () => {
const component = mountComponent();
await component.get('.btn-danger').trigger('click');
await component.get('.btn-primary').trigger('click');
component.emitted().should.have.property('success');
});
});
6 changes: 3 additions & 3 deletions test/components/entity/conflict-summary.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('EntityConflictSummary', () => {
.request(async (component) => {
await component.get('.btn-default').trigger('click');
const modal = component.getComponent(Confirmation);
await modal.get('.btn-danger').trigger('click');
await modal.get('.btn-primary').trigger('click');
})
.respondWithProblem()
.testRequests([{
Expand All @@ -74,7 +74,7 @@ describe('EntityConflictSummary', () => {
.request(async (component) => {
await component.get('.btn-default').trigger('click');
const modal = component.getComponent(Confirmation);
await modal.get('.btn-danger').trigger('click');
await modal.get('.btn-primary').trigger('click');
})
.respondWithData(() => {
testData.extendedEntities.resolve(-1);
Expand Down Expand Up @@ -110,7 +110,7 @@ describe('EntityConflictSummary', () => {
.request(async (component) => {
await component.get('.btn-default').trigger('click');
const modal = component.getComponent(Confirmation);
await modal.get('.btn-danger').trigger('click');
await modal.get('.btn-primary').trigger('click');
})
.respondWithProblem(409.15)
.afterResponse(component => {
Expand Down
2 changes: 1 addition & 1 deletion test/components/entity/show.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ describe('EntityShow', () => {
.complete()
.request(async (c) => {
await c.get('#entity-conflict-summary .btn-default').trigger('click');
await c.getComponent(Confirmation).get('.btn-danger').trigger('click');
await c.getComponent(Confirmation).get('.btn-primary').trigger('click');
})
.respondWithData(() => {
testData.extendedEntities.resolve(-1);
Expand Down

0 comments on commit 82d668c

Please sign in to comment.