Skip to content

Commit

Permalink
Merge pull request #536 from nanasess/fix-contact-on-error
Browse files Browse the repository at this point in the history
お問い合わせフォームの入力チェックでシステムエラーになるのを修正
  • Loading branch information
chihiro-adachi authored Mar 30, 2022
2 parents fa3f97c + 3ff4360 commit 3874aad
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion data/Smarty/templates/default/contact/index.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
<span class="mini">(全角<!--{$smarty.const.MLTEXT_LEN}-->字以下)</span></th>
<td>
<span class="attention"><!--{$arrErr.contents}--></span>
<textarea name="contents" class="box380" cols="60" rows="20" style="<!--{$arrErr.contents.value|h|sfGetErrorColor}-->; ime-mode: active;"><!--{"\n"}--><!--{$arrForm.contents.value|h}--></textarea>
<textarea name="contents" class="box380" cols="60" rows="20" style="<!--{$arrErr.contents|sfGetErrorColor}-->; ime-mode: active;"><!--{"\n"}--><!--{$arrForm.contents.value|h}--></textarea>
<p class="mini attention">※ご注文に関するお問い合わせには、必ず「ご注文番号」をご記入くださいますようお願いいたします。</p>
</td>
</tr>
Expand Down
12 changes: 12 additions & 0 deletions e2e-tests/test/front_login/contact.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,16 @@ test.describe.serial('お問い合わせページのテストをします', () =
.then(alerts => expect(alerts).toEqual([]));
});
});

/**
* https://github.com/EC-CUBE/ec-cube2/pull/536 のE2Eテスト
*/
test('ラーメッセージの表示を確認します', async () => {
await page.goto(PlaywrightConfig.use.baseURL); // ログアウトしてしまう場合があるので一旦トップへ遷移する
await page.goto(url);
await page.click('input[name=confirm]');
await page.pause();
await expect(page.locator('span.attention >> nth=13')).toContainText('※ お問い合わせ内容が入力されていません。');
await expect(page.locator('textarea[name=contents]')).toHaveAttribute('style', 'background-color:#ffe8e8; ime-mode: active;');
});
});

0 comments on commit 3874aad

Please sign in to comment.