Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to write Unit Tests for Apex Charts #479

Open
HarshitDubey-Raik opened this issue Jul 8, 2024 · 0 comments
Open

How to write Unit Tests for Apex Charts #479

HarshitDubey-Raik opened this issue Jul 8, 2024 · 0 comments

Comments

@HarshitDubey-Raik
Copy link

I am making use of Apex Chart. But could you please tell how to write unit test for the same?

Following is my code for reference

<MudGrid Class="pt-5">
    <MudItem md="4" sm="12" xs="12">
        <MudPaper Outlined="true" Height="30vh">
            <ApexChart Title="Work Load" TItem="LoadDto" OnDataPointSelection="WorkLoadClicked" Options="donutOptions" Height="@_heightFull">
                @if (loadallCounts is not null)
                {
                    <ApexPointSeries TItem="LoadDto"
                                     Items="overallCounts.Where(c => c.IsPending == false)"
                                     SeriesType="SeriesType.Donut"
                                     XValue="@(e => (WorkType)e.WorkType)"
                                     YAggregate="@(e => e.Sum(x => x.NumberOfWorkers))"
                                     OrderBy="e => e.X"
                                     ShowDataLabels />
                }
            </ApexChart>
        </MudPaper>
    </MudItem>
</MudGrid>

@code {
private IEnumerable<WorkLoadCountsDto>? loadallCounts;

  private void WorkLoadClicked()
  {
      /*Code Content*/
  }
}

I am making use of Bunit to write Unit Test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant