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

feat: imported project names #1031

Merged
merged 1 commit into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class ProjectMetadataPieceImporter implements ImportPieceProcessor {
.into(`projects`)
.values({
id: projectId,
name: data.name,
name: data.name + ' - copy',
description: data.description,
organization_id: organizationId,
planning_unit_grid_shape: data.planningUnitGridShape,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ const getFixtures = async () => {
getEntityManagerToken(geoprocessingConnections.apiDB.name),
);

const projectName = `test project - ${projectId}`;
const copyProjectName = projectName + ' - copy';

const validProjectMetadataFileContent: ProjectMetadataContent = {
name: `test project - ${projectId}`,
name: projectName,
description: 'project description',
planningUnitGridShape: PlanningUnitGridShape.Hexagon,
};
Expand Down Expand Up @@ -144,7 +147,9 @@ const getFixtures = async () => {
return GivenOrganizationExists(entityManager, organizationId);
},
GivenProject: () => {
return GivenProjectExists(entityManager, projectId, organizationId);
return GivenProjectExists(entityManager, projectId, organizationId, {
name: copyProjectName,
});
},
GivenJobInputWithoutUris: (): ImportJobInput => {
return {
Expand Down Expand Up @@ -198,7 +203,7 @@ const getFixtures = async () => {
.where('id = :projectId', { projectId })
.execute();

expect(project.name).toEqual(validProjectMetadataFileContent.name);
expect(project.name).toEqual(copyProjectName);
expect(project.description).toEqual(
validProjectMetadataFileContent.description,
);
Expand Down