Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
yoiteyou committed Jan 24, 2025
1 parent 54d28da commit f75c678
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ describe('EndpointPage.vue', () => {
sku: 'mockSku',
modelId: 'mockModelId',
private: 'true',
task: 'text-generation',
replicaList: [
{ name: 'Replica1', status: 'Running' },
{ name: 'Replica2', status: 'Stopped' }
Expand All @@ -76,7 +77,7 @@ describe('EndpointPage.vue', () => {
})
})

it('renders EndpointPlayground when appStatus is Running and appEndpoint is provided', () => {
it('renders EndpointPlayground when appStatus is Running and appEndpoint is provided and task is text-generation', () => {
expect(wrapper.findComponent(EndpointPlayground).exists()).toBe(true)
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ describe("EndpointPlayground", () => {
expect(wrapper.vm.playgroundMode).toBe('test');
});

it("renders TestEndpoint component in 'test' mode", () => {
const wrapper = createWrapper();
it("renders TestEndpoint component in 'test' mode when task is 'text-generation'", () => {
const wrapper = createWrapper({ task: 'text-generation' });
expect(wrapper.findComponent(TestEndpoint).exists()).toBe(true);
});

it("renders ApiExample component in 'api' mode", async () => {
const wrapper = createWrapper();
it("renders ApiExample component in 'api' mode when task is 'text-generation'", async () => {
const wrapper = createWrapper({ task: 'text-generation' });
await wrapper.find('.cursor-pointer').trigger('click');
expect(wrapper.findComponent(ApiExample).exists()).toBe(true);
expect(wrapper.findComponent(TestEndpoint).exists()).toBe(true);
Expand Down

0 comments on commit f75c678

Please sign in to comment.