Skip to content

Commit

Permalink
refac: apply PR review 1
Browse files Browse the repository at this point in the history
- src/AzureOpenAIProxy.PlaygroundApp/Components/Layout/NavMenu.razor 변경 내역 제거
- 불필요한 attribute 제거
- PlaygroundApp 프로젝트에 ApiApp 프로젝트를 참조 추가하여 ApiApp.Models.AdminEventDetails 사용
- 테스트 파일 이름 변경 (EventPageTests -> AdminEventPageTests)
- AdminEventPageTests 테스트에서 테이블 로드 waiting 시간 변경 (0.2 sec => 2 sec)
- EventDetailElemComponent 에서 SubText property의 타입을 nullable로 변경
  • Loading branch information
praivesi committed Aug 24, 2024
1 parent 3e163fd commit b482324
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 82 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

<ItemGroup>
<ProjectReference Include="..\AzureOpenAIProxy.ServiceDefaults\AzureOpenAIProxy.ServiceDefaults.csproj" />
<ProjectReference Include="..\AzureOpenAIProxy.ApiApp\AzureOpenAIProxy.ApiApp.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@page "/events"
@attribute [StreamRendering]

@using AzureOpenAIProxy.PlaygroundApp.Components.UI.Admin

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
public required string MainText { get; set; }

[Parameter]
public string SubText { get; set; }
public string? SubText { get; set; }
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@using AzureOpenAIProxy.PlaygroundApp.Components.UI.Admin

@using AzureOpenAIProxy.ApiApp.Models

<div id="evt-detail-comp">
@if (eventDetails == null)
{
Expand Down Expand Up @@ -120,78 +122,4 @@
DailyRequestCap = index * 10
}).ToArray();
}

// AdminEventDetails - declared in AzureOpenAIProxy.ApiApp.Models
private class AdminEventDetails
{
/// <summary>
/// Gets or sets the event id.
/// </summary>
public required string? EventId { get; set; }

/// <summary>
/// Gets or sets the event title name.
/// </summary>
public required string? Title { get; set; }

/// <summary>
/// Gets or sets the event summary.
/// </summary>
public required string? Summary { get; set; }

/// <summary>
/// Gets or sets the event description.
/// </summary>
public string? Description { get; set; }

/// <summary>
/// Gets or sets the event start date.
/// </summary>
public required DateTimeOffset? DateStart { get; set; }

/// <summary>
/// Gets or sets the event end date.
/// </summary>
public required DateTimeOffset? DateEnd { get; set; }

/// <summary>
/// Gets or sets the event start to end date timezone.
/// </summary>
public required string? TimeZone { get; set; }

/// <summary>
/// Gets or sets the event active status.
/// </summary>
public required bool? IsActive { get; set; }

/// <summary>
/// Gets or sets the event organizer name.
/// </summary>
public required string? OrganizerName { get; set; }

/// <summary>
/// Gets or sets the event organizer email.
/// </summary>
public required string? OrganizerEmail { get; set; }

/// <summary>
/// Gets or sets the event coorganizer name.
/// </summary>
public string? CoorganizerName { get; set; }

/// <summary>
/// Gets or sets the event coorganizer email.
/// </summary>
public string? CoorganizerEmail { get; set; }

/// <summary>
/// Gets or sets the Azure OpenAI Service request max token capacity.
/// </summary>
public required int? MaxTokenCap { get; set; }

/// <summary>
/// Gets or sets the Azure OpenAI Service daily request capacity.
/// </summary>
public required int? DailyRequestCap { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace AzureOpenAIProxy.PlaygroundApp.Tests.Pages;
[Parallelizable(ParallelScope.Self)]
[TestFixture]
[Property("Category", "Integration")]
public class EventsPageTests : PageTest
public class AdminEventsPageTests : PageTest
{
public override BrowserNewContextOptions ContextOptions() => new()
{
Expand All @@ -23,7 +23,7 @@ public async Task Given_Events_Page_When_Navigated_Then_It_Should_Have_ListEvent
var listEvtDetailsComp = await Page.QuerySelectorAsync("#evt-detail-comp");

// Assert
Assert.IsNotNull(listEvtDetailsComp, "Test Failed: #evt-detail-comp not found");
Assert.That(listEvtDetailsComp, Is.Not.Null);
}

[Test]
Expand All @@ -33,13 +33,13 @@ public async Task Given_Events_Page_When_Navigated_Then_It_Should_Have_EventDeta
await this.Page.GotoAsync("https://localhost:5001/events");

// wait for construct table
await Task.Delay(200);
await Task.Delay(2000);

// Act
var evtDetailTbl = await Page.QuerySelectorAsync("table.evt-detail-tbl");

// Assert
Assert.IsNotNull(evtDetailTbl, "Test Failed: table.evt-detail-tbl not found");
Assert.That(evtDetailTbl, Is.Not.Null);
}

[Test]
Expand All @@ -49,12 +49,12 @@ public async Task Given_Events_Page_When_Navigated_Then_It_Should_Have_EventDeta
await this.Page.GotoAsync("https://localhost:5001/events");

// wait for construct table header
await Task.Delay(200);
await Task.Delay(2000);

// Act
var evtDetailElemHeader = await Page.QuerySelectorAsync("div.evt-detail-header");

// Assert
Assert.IsNotNull(evtDetailElemHeader, "Test Failed: div.evt-detail-header not found");
Assert.That(evtDetailElemHeader, Is.Not.Null);
}
}

0 comments on commit b482324

Please sign in to comment.