Skip to content

Commit

Permalink
changes as per comments
Browse files Browse the repository at this point in the history
  • Loading branch information
SriHV committed Oct 4, 2024
1 parent dea8095 commit 5a5c638
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/components/button/_macro.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,9 @@ describe('FOR: Macro: Button', () => {

expect($('button').attr('type')).toBe('special-type');
});

it('THEN: has the provided type attribute if variant contains print', () => {
});
describe('WHEN: type parameter is provided and variant contains print', () => {
it('THEN: has the provided type attribute', () => {
const $ = cheerio.load(
renderComponent('button', {
type: 'special-type',
Expand All @@ -259,8 +260,9 @@ describe('FOR: Macro: Button', () => {

expect($('button').attr('type')).toBe('submit');
});

it('THEN: defaults to being a button if variants contains print', () => {
});
describe('WHEN: type parameter is not provided and variant contains print', () => {
it('THEN: defaults to being a button', () => {
const $ = cheerio.load(
renderComponent('button', {
variants: 'print',
Expand Down Expand Up @@ -324,7 +326,7 @@ describe('FOR: Macro: Button', () => {
newWindow: true,
}),
);
expect($('.ons-btn__new-window-description').text()).toBe(' (opens in a new tab)');
expect($('.ons-btn__new-window-description').text()).toBe('(opens in a new tab)');
});
});
describe('WHEN: url parameter is provided, newWindow is true and newWindowDescription is provided', () => {
Expand All @@ -336,7 +338,7 @@ describe('FOR: Macro: Button', () => {
newWindowDescription: 'custom opens in a new window text',
}),
);
expect($('.ons-btn__new-window-description').text()).toBe(' (custom opens in a new window text)');
expect($('.ons-btn__new-window-description').text()).toBe('(custom opens in a new window text)');
});
});
});
Expand Down

0 comments on commit 5a5c638

Please sign in to comment.