Skip to content

Commit fdfe550

Browse files
committed
Fix browser tests
1 parent 9f4bd03 commit fdfe550

File tree

8 files changed

+22
-14
lines changed

8 files changed

+22
-14
lines changed

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ module.exports = {
4242
compatConfig: {
4343
MODE: 3,
4444
COMPILER_V_ON_NATIVE: true,
45-
COMPILER_V_BIND_SYNC: false
45+
COMPILER_V_BIND_SYNC: true
4646
}
4747
}
4848
}

resources/js/Pages/Results.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
</form>
110110
</section>
111111
</section>
112-
<cdx-dialog class="confirmation-dialog"
112+
<cdx-dialog id="results-confirmation-dialog"
113113
:title="$i18n('confirmation-dialog-title')"
114114
v-model:open="confirmationDialog"
115115
:primary-action="{
@@ -118,6 +118,7 @@
118118
actionType: 'progressive'
119119
120120
}"
121+
@update:open="disableConfirmation = false"
121122
@primary="_handleConfirmation"
122123
close-button-label="X"
123124
>

tests/Browser/Components/DecisionDropdown.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function __construct(int $mismatchId)
1919
*/
2020
public function selector()
2121
{
22-
return "#mismatch-$this->mismatchId .wikit-Dropdown";
22+
return "#mismatch-$this->mismatchId .cdx-select-vue";
2323
}
2424

2525
/**
@@ -41,17 +41,17 @@ public function assert(Browser $browser)
4141
public function elements()
4242
{
4343
return [
44-
'@select-menu' => '.wikit-Dropdown__select',
45-
'@selected' => '.wikit-Dropdown__selectedOption',
46-
'@menu-items' => '.wikit-Dropdown__menu'
44+
'@select-menu' => '.cdx-select-vue__handle',
45+
'@selected' => '.cdx-select-vue__handle',
46+
'@menu-items' => '.cdx-menu__listbox'
4747
];
4848
}
4949

5050
public function selectPosition(Browser $browser, int $position, string $option)
5151
{
5252
$browser->click('@select-menu')
5353
->within('@menu-items', function ($menu) use ($position, $option) {
54-
$positionSelector = ".wikit-OptionsMenu__item:nth-child($position)";
54+
$positionSelector = ".cdx-menu-item:nth-child($position)";
5555
$menu->assertSeeIn($positionSelector, $option)
5656
->click($positionSelector);
5757
})

tests/Browser/ItemsFormTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ public function test_empty_item_list_yields_warning()
4848
->press('.submit-ids')
4949
->assertSee('Please provide the Item identifiers that should be checked.');
5050

51-
$this->assertStringContainsString('--warning', $browser->attribute('@items-input', 'class'));
51+
$this->assertStringContainsString(
52+
'--warning',
53+
$browser->attribute('@items-input-validation-message', 'class')
54+
);
5255
});
5356
}
5457

@@ -72,7 +75,10 @@ public function test_invalid_item_list_yields_error()
7275
->press('.submit-ids')
7376
->assertSee('One or more Item identifiers couldn\'t be processed.');
7477

75-
$this->assertStringContainsString('--error', $browser->attribute('@items-input', 'class'));
78+
$this->assertStringContainsString(
79+
'--error',
80+
$browser->attribute('@items-input-validation-message', 'class')
81+
);
7682
});
7783
}
7884

tests/Browser/Pages/HomePage.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ public function elements()
4040
{
4141
return [
4242
'@form' => '#items-form',
43-
'@items-input' => '@form textarea'
43+
'@items-input' => '@form textarea',
44+
'@items-input-validation-message' => '@form .wikit-TextArea .wikit-ValidationMessage'
4445
];
4546
}
4647
}

tests/Browser/Pages/ResultsPage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function elements()
4747
{
4848
return [
4949
'@back-button' => '.back-button',
50-
'@confirmation-dialog' => '.confirmation-dialog',
50+
'@confirmation-dialog' => '#results-confirmation-dialog',
5151
'@disable-confirmation' => '.disable-confirmation',
5252
'@error-section' => '#error-section',
5353
'@disable-confirmation-label' => '.disable-confirmation>.wikit-checkbox__label'

tests/Browser/ResultsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ public function test_can_disable_confirmation_dialog()
343343
'label' => 'Wrong data on external source'
344344
])
345345
->waitFor('@confirmation-dialog')
346-
->pause(250)
346+
->pause(self::ANIMATION_WAIT_MS)
347347
->within('@confirmation-dialog', function ($dialog) {
348348
$dialog->assertSee('Do not show again')
349349
->assertVue('checked', false, '@disable-confirmation')
@@ -392,7 +392,7 @@ public function test_disable_confirmation_checkbox_resets()
392392
$dialog->assertSee('Do not show again')
393393
->assertVue('checked', false, '@disable-confirmation')
394394
->click('@disable-confirmation-label')
395-
->click('.wikit-Dialog__close');
395+
->click('.cdx-dialog__header__close-button');
396396
})
397397
->waitUntilMissing('@confirmation-dialog')
398398
->decideAndApply($mismatch, [

webpack.mix.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ mix.ts('resources/js/app.ts', 'public/js')
3232
compatConfig: {
3333
MODE: 3,
3434
COMPILER_V_ON_NATIVE: true,
35-
COMPILER_V_BIND_SYNC: false
35+
COMPILER_V_BIND_SYNC: true
3636
}
3737
}
3838
}

0 commit comments

Comments
 (0)