forked from mermaid-js/mermaid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request mermaid-js#4839 from mermaid-js/feat/948_packetDia…
…gram feat: Add packet diagram
- Loading branch information
Showing
52 changed files
with
1,300 additions
and
256 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -24,6 +24,7 @@ const MERMAID_CONFIG_DIAGRAM_KEYS = [ | |
'gitGraph', | ||
'c4', | ||
'sankey', | ||
'packet', | ||
] as const; | ||
|
||
/** | ||
|
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { imgSnapshotTest } from '../../helpers/util'; | ||
|
||
describe('packet structure', () => { | ||
it('should render a simple packet diagram', () => { | ||
imgSnapshotTest( | ||
`packet-beta | ||
title Hello world | ||
0-10: "hello" | ||
` | ||
); | ||
}); | ||
|
||
it('should render a complex packet diagram', () => { | ||
imgSnapshotTest( | ||
`packet-beta | ||
0-15: "Source Port" | ||
16-31: "Destination Port" | ||
32-63: "Sequence Number" | ||
64-95: "Acknowledgment Number" | ||
96-99: "Data Offset" | ||
100-105: "Reserved" | ||
106: "URG" | ||
107: "ACK" | ||
108: "PSH" | ||
109: "RST" | ||
110: "SYN" | ||
111: "FIN" | ||
112-127: "Window" | ||
128-143: "Checksum" | ||
144-159: "Urgent Pointer" | ||
160-191: "(Options and Padding)" | ||
192-223: "data" | ||
` | ||
); | ||
}); | ||
|
||
it('should render a complex packet diagram with showBits false', () => { | ||
imgSnapshotTest( | ||
` | ||
--- | ||
title: "Packet Diagram" | ||
config: | ||
packet: | ||
showBits: false | ||
--- | ||
packet-beta | ||
0-15: "Source Port" | ||
16-31: "Destination Port" | ||
32-63: "Sequence Number" | ||
64-95: "Acknowledgment Number" | ||
96-99: "Data Offset" | ||
100-105: "Reserved" | ||
106: "URG" | ||
107: "ACK" | ||
108: "PSH" | ||
109: "RST" | ||
110: "SYN" | ||
111: "FIN" | ||
112-127: "Window" | ||
128-143: "Checksum" | ||
144-159: "Urgent Pointer" | ||
160-191: "(Options and Padding)" | ||
192-223: "data" | ||
` | ||
); | ||
}); | ||
}); |
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.