-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: More migration to new Angular control flow
- Loading branch information
Showing
25 changed files
with
840 additions
and
400 deletions.
There are no files selected for viewing
4 changes: 0 additions & 4 deletions
4
frontend/src/app/projects/create-project/create-project.component.css
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
frontend/src/app/projects/create-project/create-project.stories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/* | ||
* SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
import { Meta, moduleMetadata, StoryObj } from '@storybook/angular'; | ||
import { userEvent, within } from '@storybook/test'; | ||
import { | ||
mockProject, | ||
MockProjectWrapperService, | ||
} from '../../../storybook/project'; | ||
import { | ||
mockProjectUsers, | ||
MockProjectUserService, | ||
} from '../../../storybook/project-users'; | ||
import { ProjectUserService } from '../project-detail/project-users/service/project-user.service'; | ||
import { ProjectWrapperService } from '../service/project.service'; | ||
import { CreateProjectComponent } from './create-project.component'; | ||
|
||
const meta: Meta<CreateProjectComponent> = { | ||
title: 'Project Components / Create Project', | ||
component: CreateProjectComponent, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<CreateProjectComponent>; | ||
|
||
export const CreateProject: Story = { | ||
args: {}, | ||
}; | ||
|
||
export const AddTeamMembers: Story = { | ||
args: {}, | ||
decorators: [ | ||
moduleMetadata({ | ||
providers: [ | ||
{ | ||
provide: ProjectWrapperService, | ||
useFactory: () => | ||
new MockProjectWrapperService(mockProject, [mockProject]), | ||
}, | ||
{ | ||
provide: ProjectUserService, | ||
useFactory: () => | ||
new MockProjectUserService('user', undefined, mockProjectUsers), | ||
}, | ||
], | ||
}), | ||
], | ||
play: async ({ canvasElement }) => { | ||
const canvas = within(canvasElement); | ||
const nameField = canvas.getByTestId('input-name'); | ||
await userEvent.type(nameField, 'Test Project'); | ||
const createProject = canvas.getByTestId('button-create-project'); | ||
await userEvent.click(createProject); | ||
}, | ||
}; | ||
|
||
export const AddModel: Story = { | ||
args: {}, | ||
decorators: [ | ||
moduleMetadata({ | ||
providers: [ | ||
{ | ||
provide: ProjectWrapperService, | ||
useFactory: () => | ||
new MockProjectWrapperService(mockProject, [mockProject]), | ||
}, | ||
{ | ||
provide: ProjectUserService, | ||
useFactory: () => | ||
new MockProjectUserService('user', undefined, mockProjectUsers), | ||
}, | ||
], | ||
}), | ||
], | ||
play: async ({ canvasElement }) => { | ||
const canvas = within(canvasElement); | ||
const nameField = canvas.getByTestId('input-name'); | ||
await userEvent.type(nameField, 'Test Project'); | ||
const createProject = canvas.getByTestId('button-create-project'); | ||
await userEvent.click(createProject); | ||
const skipMembers = canvas.getByTestId('button-skipAddMembers'); | ||
await userEvent.click(skipMembers); | ||
}, | ||
}; |
4 changes: 0 additions & 4 deletions
4
frontend/src/app/projects/models/init-model/init-model.component.css
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.