mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-11 08:43:02 +00:00
Massive refactor for 3rd party import
This commit is contained in:
@@ -1,18 +1,19 @@
|
||||
describe("Serializer Service", function() {
|
||||
beforeEach(module('app'));
|
||||
|
||||
var Ship, Serializer;
|
||||
var Ship,
|
||||
Serializer,
|
||||
code = '48A6A6A5A8A8A5C2c0o0o0o1m1m0q0q0404-0l0b0100034k5n052d04--0303326b',
|
||||
anaconda = DB.ships['anaconda'],
|
||||
testBuild,
|
||||
exportData;
|
||||
|
||||
beforeEach(inject(function (_Ship_, _Serializer_) {
|
||||
Ship = _Ship_;
|
||||
Serializer = _Serializer_;
|
||||
}));
|
||||
|
||||
describe("Detailed Export", function() {
|
||||
var code = '48A6A6A5A8A8A5C2c0o0o0o1m1m0q0q0404-0l0b0100034k5n052d04--0303326b.AwRj4yo5dig=.MwBhEYy6duwEziA',
|
||||
anaconda = DB.ships['anaconda'],
|
||||
testBuild,
|
||||
exportData;
|
||||
describe("To Detailed Build", function() {
|
||||
|
||||
beforeEach(function() {
|
||||
testBuild = new Ship('anaconda', anaconda.properties, anaconda.slots);
|
||||
@@ -37,4 +38,20 @@ describe("Serializer Service", function() {
|
||||
|
||||
});
|
||||
|
||||
describe("From Detailed Build", function() {
|
||||
|
||||
it("builds the ship correctly", function() {
|
||||
var anacondaTestExport = __json__['fixtures/anaconda-test-detailed-export'];
|
||||
testBuildA = new Ship('anaconda', anaconda.properties, anaconda.slots);
|
||||
Serializer.toShip(testBuildA, code);
|
||||
testBuildB = Serializer.fromDetailedBuild(anacondaTestExport);
|
||||
|
||||
for(var p in testBuildB) {
|
||||
expect(testBuildB[p]).toEqual(testBuildA[p], p + ' does not match');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user