Skip to content

Commit cebd00a

Browse files
committed
wip
1 parent 0b2a8d6 commit cebd00a

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

tests/Browser/PluginSettingsTest.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,6 @@
6060
->assertSourceHas(INACTIVE_ADMIN_COMMENT);
6161
});
6262

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-
7363
it('adds a script with collect do not track enabled', function () {
7464
asAdmin()->navigate('http://localhost:8100/wp-admin/options-general.php?page=simpleanalytics&tab=advanced')
7565
->check('simpleanalytics_collect_dnt')
@@ -112,7 +102,16 @@
112102
->click('Save Changes')
113103
->assertValue('simpleanalytics_onload_callback', 'sa_event("My event")');
114104

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"');
116115
});
117116

118117
it('adds a script with global variable name', function () {
@@ -188,11 +187,12 @@
188187
visit('http://localhost:8100')->assertSourceHas('data-sa-global="ba_event"');
189188
});
190189

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')
194194
->click('Save Changes')
195-
->assertValue('simpleanalytics_hostname', 'example.com');
195+
->assertValue('simpleanalytics_custom_domain', 'mydomain.com');
196196

197-
visit('http://localhost:8100')->assertSourceHas('data-hostname="example.com"');
197+
visit('http://localhost:8100')->assertPresent('script[src="https://mydomain.com/latest.js"]');
198198
});

0 commit comments

Comments
 (0)