Skip to content

Commit e023f24

Browse files
committed
Feat: Update toggle icon and label
1 parent 4cce685 commit e023f24

File tree

2 files changed

+6
-6
lines changed
  • packages/components/src/components/hds/code-block
  • showcase/tests/integration/components/hds/code-block

2 files changed

+6
-6
lines changed

packages/components/src/components/hds/code-block/index.hbs

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
<div class="hds-code-block__overlay-footer">
3535
<Hds::Button
3636
class="hds-code-block__height-toggle-button"
37-
@text={{if this._isExpanded "Show less" "Show more"}}
37+
@text={{if this._isExpanded "Show less code" "Show more code"}}
3838
@color="secondary"
39-
@icon={{if this._isExpanded "chevron-up" "chevron-down"}}
39+
@icon={{if this._isExpanded "unfold-close" "unfold-open"}}
4040
@size="small"
4141
{{on "click" this.toggleExpanded}}
4242
/>

showcase/tests/integration/components/hds/code-block/index-test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ module('Integration | Component | hds/code-block/index', function (hooks) {
241241
assert
242242
.dom('.hds-code-block__height-toggle-button')
243243
.exists()
244-
.hasText('Show more');
244+
.hasText('Show more code');
245245
});
246246

247247
test('it does not display a height toggle button if the height of the code content is less than the maxHeight', async function (assert) {
@@ -265,7 +265,7 @@ module('Integration | Component | hds/code-block/index', function (hooks) {
265265
assert
266266
.dom('.hds-code-block__height-toggle-button')
267267
.exists()
268-
.hasText('Show less');
268+
.hasText('Show less code');
269269
});
270270

271271
test('it collapses to show less content and displays a "Show more" button when "Show less" is clicked', async function (assert) {
@@ -278,7 +278,7 @@ module('Integration | Component | hds/code-block/index', function (hooks) {
278278
assert
279279
.dom('.hds-code-block__height-toggle-button')
280280
.exists()
281-
.hasText('Show less');
281+
.hasText('Show less code');
282282

283283
await click('.hds-code-block__height-toggle-button');
284284

@@ -288,7 +288,7 @@ module('Integration | Component | hds/code-block/index', function (hooks) {
288288
assert
289289
.dom('.hds-code-block__height-toggle-button')
290290
.exists()
291-
.hasText('Show more');
291+
.hasText('Show more code');
292292
});
293293

294294
// ASSERTION

0 commit comments

Comments
 (0)