Add cargo hatch priority and status to be included in detailed export

This commit is contained in:
Colin McLeod
2015-09-01 18:36:57 -07:00
parent aac4c9a872
commit 1970616443
7 changed files with 54 additions and 34 deletions

View File

@@ -98,8 +98,8 @@ describe('Import Controller', function() {
describe('Import Detailed Build', function() {
it('imports a valid build', function() {
var importData = __json__['fixtures/anaconda-test-detailed-export'];
it('imports a valid v1 build', function() {
var importData = __json__['fixtures/anaconda-test-detailed-export-v1'];
scope.importString = angular.toJson(importData);
scope.validateImport();
expect(scope.importValid).toBeTruthy();
@@ -108,12 +108,26 @@ describe('Import Controller', function() {
expect(scope.processed).toBeTruthy();
scope.import();
expect(angular.fromJson(localStorage.getItem('builds'))).toEqual({
anaconda: { 'Test': '48A6A6A5A8A8A5C2c0o0o0o1m1m0q0q0404-0l0b0100034k5n052d04--0303326b.Iw18QDBNA===.AwhMJBGaei+JCyyiA===' }
anaconda: { 'Test': '48A6A6A5A8A8A5C2c0o0o0o1m1m0q0q0404-0l0b0100034k5n052d04--0303326b.Iw18ZlA=.Aw18ZlA=' }
});
});
it('imports a valid v2 build', function() {
var importData = __json__['fixtures/anaconda-test-detailed-export-v2'];
scope.importString = angular.toJson(importData);
scope.validateImport();
expect(scope.importValid).toBeTruthy();
expect(scope.errorMsg).toEqual(null);
scope.process();
expect(scope.processed).toBeTruthy();
scope.import();
expect(angular.fromJson(localStorage.getItem('builds'))).toEqual({
anaconda: { 'Test': '48A6A6A5A8A8A5C2c0o0o0o1m1m0q0q0404-0l0b0100034k5n052d04--0303326b.AwRj4zNKqA==.CwBhCYzBGW9qCTSqs5xA' }
});
});
it('catches an invalid build', function() {
var importData = __json__['fixtures/anaconda-test-detailed-export'];
var importData = __json__['fixtures/anaconda-test-detailed-export-v2'];
scope.importString = angular.toJson(importData).replace('components', 'comps');
scope.validateImport();
expect(scope.importValid).toBeFalsy();

View File

@@ -3,7 +3,7 @@ describe("Serializer Service", function() {
var Ship,
Serializer,
code = '48A6A6A5A8A8A5C2c0o0o0o1m1m0q0q0404-0l0b0100034k5n052d04--0303326b.Iw18QDBNA===.AwhMJBGaei+JCyyiA===',
code = '48A6A6A5A8A8A5C2c0o0o0o1m1m0q0q0404-0l0b0100034k5n052d04--0303326b.AwRj4zNKqA==.CwBhCYzBGW9qCTSqs5xA',
anaconda = DB.ships['anaconda'],
testBuild,
exportData;
@@ -21,13 +21,6 @@ describe("Serializer Service", function() {
exportData = Serializer.toDetailedBuild('Test', testBuild, code);
});
it("conforms to the v1 ship-loadout schema", function() {
var shipLoadoutSchema = __json__['schemas/ship-loadout/1'];
var validate = jsen(shipLoadoutSchema);
var valid = validate(exportData);
expect(valid).toBeTruthy();
});
it("conforms to the v2 ship-loadout schema", function() {
var shipLoadoutSchema = __json__['schemas/ship-loadout/2'];
var validate = jsen(shipLoadoutSchema);
@@ -36,7 +29,7 @@ describe("Serializer Service", function() {
});
it("contains the correct components and stats", function() {
var anacondaTestExport = __json__['fixtures/anaconda-test-detailed-export'];
var anacondaTestExport = __json__['fixtures/anaconda-test-detailed-export-v2'];
expect(exportData.components).toEqual(anacondaTestExport.components);
expect(exportData.stats).toEqual(anacondaTestExport.stats);
expect(exportData.ship).toEqual(anacondaTestExport.ship);
@@ -48,7 +41,7 @@ describe("Serializer Service", function() {
describe("From Detailed Build", function() {
it("builds the ship correctly", function() {
var anacondaTestExport = __json__['fixtures/anaconda-test-detailed-export'];
var anacondaTestExport = __json__['fixtures/anaconda-test-detailed-export-v2'];
testBuildA = new Ship('anaconda', anaconda.properties, anaconda.slots);
Serializer.toShip(testBuildA, code);
testBuildB = Serializer.fromDetailedBuild(anacondaTestExport);