Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change button class in Confirmation modal #900

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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