|
60 | 60 | ->assertSourceHas(INACTIVE_ADMIN_COMMENT); |
61 | 61 | }); |
62 | 62 |
|
63 | | -it('adds a script with a custom domain name', function () { |
64 | | - asAdmin() |
65 | | - ->navigate('http://localhost:8100/wp-admin/options-general.php?page=simpleanalytics&tab=general') |
66 | | - ->fill('simpleanalytics_custom_domain', 'mydomain.com') |
67 | | - ->click('Save Changes') |
68 | | - ->assertValue('simpleanalytics_custom_domain', 'mydomain.com'); |
69 | | - |
70 | | - visit('http://localhost:8100')->assertPresent('script[src="https://mydomain.com/latest.js"]'); |
71 | | -}); |
72 | | - |
73 | 63 | it('adds a script with collect do not track enabled', function () { |
74 | 64 | asAdmin()->navigate('http://localhost:8100/wp-admin/options-general.php?page=simpleanalytics&tab=advanced') |
75 | 65 | ->check('simpleanalytics_collect_dnt') |
|
112 | 102 | ->click('Save Changes') |
113 | 103 | ->assertValue('simpleanalytics_onload_callback', 'sa_event("My event")'); |
114 | 104 |
|
115 | | - visit('http://localhost:8100')->dd()->assertSourceHas('data-onload="sa_event(\"My event\")"'); |
| 105 | + visit('http://localhost:8100')->assertSourceHas('data-onload="sa_event(\"My event\")"'); |
| 106 | +}); |
| 107 | + |
| 108 | +it('adds a script with overwrite domain name', function () { |
| 109 | + asAdmin()->navigate('http://localhost:8100/wp-admin/options-general.php?page=simpleanalytics&tab=advanced') |
| 110 | + ->fill('simpleanalytics_hostname', 'example.com') |
| 111 | + ->click('Save Changes') |
| 112 | + ->assertValue('simpleanalytics_hostname', 'example.com'); |
| 113 | + |
| 114 | + visit('http://localhost:8100')->assertSourceHas('data-hostname="example.com"'); |
116 | 115 | }); |
117 | 116 |
|
118 | 117 | it('adds a script with global variable name', function () { |
|
188 | 187 | visit('http://localhost:8100')->assertSourceHas('data-sa-global="ba_event"'); |
189 | 188 | }); |
190 | 189 |
|
191 | | -it('adds a script with overwrite domain name', function () { |
192 | | - asAdmin()->navigate('http://localhost:8100/wp-admin/options-general.php?page=simpleanalytics&tab=advanced') |
193 | | - ->fill('simpleanalytics_hostname', 'example.com') |
| 190 | +it('adds a script with a custom domain name', function () { |
| 191 | + asAdmin() |
| 192 | + ->navigate('http://localhost:8100/wp-admin/options-general.php?page=simpleanalytics&tab=general') |
| 193 | + ->fill('simpleanalytics_custom_domain', 'mydomain.com') |
194 | 194 | ->click('Save Changes') |
195 | | - ->assertValue('simpleanalytics_hostname', 'example.com'); |
| 195 | + ->assertValue('simpleanalytics_custom_domain', 'mydomain.com'); |
196 | 196 |
|
197 | | - visit('http://localhost:8100')->assertSourceHas('data-hostname="example.com"'); |
| 197 | + visit('http://localhost:8100')->assertPresent('script[src="https://mydomain.com/latest.js"]'); |
198 | 198 | }); |
0 commit comments