-
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.
fix(ui,signatures): ignore everything except cosmic signature or anomaly
- Loading branch information
Showing
4 changed files
with
56 additions
and
3 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
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
40 changes: 40 additions & 0 deletions
40
ui/src/test/scala/controltower/page/map/view/PasteSignatureViewSpec.scala
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,40 @@ | ||
package controltower.page.map.view | ||
|
||
import zio.test.* | ||
|
||
object PasteSignatureViewSpec extends ZIOSpecDefault: | ||
|
||
override def spec = | ||
suite("Signature parsing")( | ||
test("Works on all signature types"): | ||
val clipboard = | ||
""" | ||
|WZB-024 Cosmic Signature Combat Site 0.0% 32.13 AU | ||
|PIA-435 Cosmic Signature 0.0% 28.15 AU | ||
|JEY-515 Cosmic Signature Data Site 0.0% 19.06 AU | ||
|THS-490 Cosmic Signature Wormhole Unstable Wormhole 100.0% 4.94 AU | ||
|ULL-880 Cosmic Signature Gas Site 0.0% 9.93 AU | ||
|WFD-000 Cosmic Signature Relic Site Forgotten Frontier Evacuation Center 0.0% 9.93 AU | ||
|IXC-218 Ship Mining Barge Covetor 100.0% 4,710 km | ||
|JLH-924 Cosmic Anomaly Ore Site Ordinary Perimeter Deposit 100.0% 38.53 AU | ||
|""".stripMargin | ||
val expected = List( | ||
ParsedLine("WZB-024", "Cosmic Signature", "Combat Site", "", "0.0%", "32.13 AU"), | ||
ParsedLine("PIA-435", "Cosmic Signature", "", "", "0.0%", "28.15 AU"), | ||
ParsedLine("JEY-515", "Cosmic Signature", "Data Site", "", "0.0%", "19.06 AU"), | ||
ParsedLine("THS-490", "Cosmic Signature", "Wormhole", "Unstable Wormhole", "100.0%", "4.94 AU"), | ||
ParsedLine("ULL-880", "Cosmic Signature", "Gas Site", "", "0.0%", "9.93 AU"), | ||
ParsedLine( | ||
"WFD-000", | ||
"Cosmic Signature", | ||
"Relic Site", | ||
"Forgotten Frontier Evacuation Center", | ||
"0.0%", | ||
"9.93 AU" | ||
), | ||
ParsedLine("IXC-218", "Ship", "Mining Barge", "Covetor", "100.0%", "4,710 km"), | ||
ParsedLine("JLH-924", "Cosmic Anomaly", "Ore Site", "Ordinary Perimeter Deposit", "100.0%", "38.53 AU") | ||
) | ||
val res = parseLines(clipboard) | ||
assertTrue(res == Right(expected)) | ||
) |