75 lines
2.3 KiB
C#
75 lines
2.3 KiB
C#
using Paca.Browser.Tabs;
|
|
using Xunit;
|
|
|
|
namespace Paca.Tests.Browser;
|
|
|
|
public class ChromeOmniboxActionsTests
|
|
{
|
|
[Theory]
|
|
[InlineData("인터넷 기록 삭제")]
|
|
[InlineData("기록 삭제")]
|
|
[InlineData("clear browsing data")]
|
|
[InlineData("clear history")]
|
|
public void Matches_ClearBrowsingData_Action(string query)
|
|
{
|
|
var actions = OmniboxActionEvaluator.GetMatchingActions(query);
|
|
Assert.NotEmpty(actions);
|
|
Assert.Contains(actions, a => a.ActionId == "action:clear-data");
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData("설정")]
|
|
[InlineData("settings")]
|
|
[InlineData("환경설정")]
|
|
public void Matches_Settings_Action(string query)
|
|
{
|
|
var actions = OmniboxActionEvaluator.GetMatchingActions(query);
|
|
Assert.NotEmpty(actions);
|
|
Assert.Contains(actions, a => a.ActionId == "action:settings");
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData("비밀번호")]
|
|
[InlineData("passwords")]
|
|
[InlineData("비밀번호 관리")]
|
|
public void Matches_Passwords_Action(string query)
|
|
{
|
|
var actions = OmniboxActionEvaluator.GetMatchingActions(query);
|
|
Assert.NotEmpty(actions);
|
|
Assert.Contains(actions, a => a.ActionId == "action:passwords");
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData("다운로드")]
|
|
[InlineData("downloads")]
|
|
public void Matches_Downloads_Action(string query)
|
|
{
|
|
var actions = OmniboxActionEvaluator.GetMatchingActions(query);
|
|
Assert.NotEmpty(actions);
|
|
Assert.Contains(actions, a => a.ActionId == "action:downloads");
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData("시크릿")]
|
|
[InlineData("시크릿 모드")]
|
|
[InlineData("incognito")]
|
|
[InlineData("비공개 창")]
|
|
public void Matches_Incognito_Action(string query)
|
|
{
|
|
var actions = OmniboxActionEvaluator.GetMatchingActions(query);
|
|
Assert.NotEmpty(actions);
|
|
Assert.Contains(actions, a => a.ActionId == "action:incognito");
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData("https://google.com")]
|
|
[InlineData("고양이 사료 추천")]
|
|
[InlineData("apple")]
|
|
[InlineData("")]
|
|
[InlineData(" ")]
|
|
public void Returns_Empty_For_Unrelated_Queries(string query)
|
|
{
|
|
var actions = OmniboxActionEvaluator.GetMatchingActions(query);
|
|
Assert.Empty(actions);
|
|
}
|
|
}
|