mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 06:19:24 +02:00
Reworked code comments
This commit is contained in:
@@ -581,4 +581,63 @@ class C13["With Città foreign language"]
|
|||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('renders a class diagram with a generic class in a namespace', () => {
|
||||||
|
const diagramDefinition = `
|
||||||
|
classDiagram-v2
|
||||||
|
namespace Company.Project.Module {
|
||||||
|
class GenericClass~T~ {
|
||||||
|
+addItem(item: T)
|
||||||
|
+getItem() T
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
imgSnapshotTest(diagramDefinition);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders a class diagram with nested namespaces and relationships', () => {
|
||||||
|
const diagramDefinition = `
|
||||||
|
classDiagram-v2
|
||||||
|
namespace Company.Project.Module.SubModule {
|
||||||
|
class Report {
|
||||||
|
+generatePDF(data: List)
|
||||||
|
+generateCSV(data: List)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
namespace Company.Project.Module {
|
||||||
|
class Admin {
|
||||||
|
+generateReport()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Admin --> Report : generates
|
||||||
|
`;
|
||||||
|
|
||||||
|
imgSnapshotTest(diagramDefinition);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders a class diagram with multiple classes and relationships in a namespace', () => {
|
||||||
|
const diagramDefinition = `
|
||||||
|
classDiagram-v2
|
||||||
|
namespace Company.Project.Module {
|
||||||
|
class User {
|
||||||
|
+login(username: String, password: String)
|
||||||
|
+logout()
|
||||||
|
}
|
||||||
|
class Admin {
|
||||||
|
+addUser(user: User)
|
||||||
|
+removeUser(user: User)
|
||||||
|
+generateReport()
|
||||||
|
}
|
||||||
|
class Report {
|
||||||
|
+generatePDF(reportData: List)
|
||||||
|
+generateCSV(reportData: List)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Admin --> User : manages
|
||||||
|
Admin --> Report : generates
|
||||||
|
`;
|
||||||
|
|
||||||
|
imgSnapshotTest(diagramDefinition);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user