|
12 | 12 |
|
13 | 13 | let(:expected_html) do |
14 | 14 | <<~HTML |
15 | | - <svg class="usa-icon" style="transform: scale(1)" aria-hidden="true" role="img"> |
| 15 | + <svg class="usa-icon" aria-hidden="true" role="img"> |
16 | 16 | <use xlink:href=/assets/@uswds/uswds/dist/img/sprite-9865eea7b251e43137fb770626d6cd51c474a3a436678a6e66cafce50968076f.svg#lock></use> |
17 | 17 | </svg> |
18 | 18 | HTML |
|
24 | 24 |
|
25 | 25 | it { is_expected.to match_html_fragment(expected_html) } |
26 | 26 |
|
27 | | - context 'changed size' do |
| 27 | + context 'icon size 3' do |
| 28 | + let(:component) { described_class.new('circle_check', size: 3) } |
| 29 | + let(:expected_html) do |
| 30 | + <<~HTML |
| 31 | + <svg class="usa-icon usa-icon--size-3" aria-hidden="true" role="img"> |
| 32 | + <use xlink:href=/assets/@uswds/uswds/dist/img/sprite-9865eea7b251e43137fb770626d6cd51c474a3a436678a6e66cafce50968076f.svg#circle_check></use> |
| 33 | + </svg> |
| 34 | + HTML |
| 35 | + end |
| 36 | + |
| 37 | + it { is_expected.to match_html_fragment(expected_html) } |
| 38 | + end |
| 39 | + |
| 40 | + context 'no icon size' do |
| 41 | + let(:component) { described_class.new('circle_check') } |
| 42 | + let(:expected_html) do |
| 43 | + <<~HTML |
| 44 | + <svg class="usa-icon" aria-hidden="true" role="img"> |
| 45 | + <use xlink:href=/assets/@uswds/uswds/dist/img/sprite-9865eea7b251e43137fb770626d6cd51c474a3a436678a6e66cafce50968076f.svg#circle_check></use> |
| 46 | + </svg> |
| 47 | + HTML |
| 48 | + end |
| 49 | + |
| 50 | + it { is_expected.to match_html_fragment(expected_html) } |
| 51 | + end |
| 52 | + |
| 53 | + context 'icon size 2' do |
28 | 54 | let(:component) { described_class.new('circle_check', size: 2) } |
29 | 55 | let(:expected_html) do |
30 | 56 | <<~HTML |
31 | | - <svg class="usa-icon" style="transform: scale(2)" aria-hidden="true" role="img"> |
| 57 | + <svg class="usa-icon" aria-hidden="true" role="img"> |
32 | 58 | <use xlink:href=/assets/@uswds/uswds/dist/img/sprite-9865eea7b251e43137fb770626d6cd51c474a3a436678a6e66cafce50968076f.svg#circle_check></use> |
33 | 59 | </svg> |
34 | 60 | HTML |
35 | 61 | end |
36 | 62 |
|
37 | 63 | it { is_expected.to match_html_fragment(expected_html) } |
38 | 64 | end |
| 65 | + |
| 66 | + context 'icon size 10' do |
| 67 | + let(:component) { described_class.new('circle_check', size: 10) } |
| 68 | + let(:expected_html) do |
| 69 | + <<~HTML |
| 70 | + <svg class="usa-icon" aria-hidden="true" role="img"> |
| 71 | + <use xlink:href=/assets/@uswds/uswds/dist/img/sprite-9865eea7b251e43137fb770626d6cd51c474a3a436678a6e66cafce50968076f.svg#circle_check></use> |
| 72 | + </svg> |
| 73 | + HTML |
| 74 | + end |
| 75 | + |
| 76 | + it { is_expected.to match_html_fragment(expected_html) } |
| 77 | + end |
| 78 | + |
39 | 79 | context 'added classes' do |
40 | 80 | let(:component) { described_class.new('lock', additional_classes: %w[foo bar]) } |
41 | 81 | let(:expected_html) do |
42 | 82 | <<~HTML |
43 | | - <svg class="foo bar usa-icon" style="transform: scale(1)" aria-hidden="true" role="img"> |
| 83 | + <svg class="foo bar usa-icon" aria-hidden="true" role="img"> |
44 | 84 | <use xlink:href=/assets/@uswds/uswds/dist/img/sprite-9865eea7b251e43137fb770626d6cd51c474a3a436678a6e66cafce50968076f.svg#lock></use> |
45 | 85 | </svg> |
46 | 86 | HTML |
|
0 commit comments