const assert = require('chai').assert;
const Complex = require('../src/js/Complex.js');
const Matrix = require('../src/js/Matrix.js');
const Monomial = require('../src/js/Monomial.js');
const Term = require('../src/js/Term.js');
const Polynomial = require('../src/js/Polynomial.js');

describe('Matrix', function() {
    describe('det', function() {
        it('computes the determinant of a 3x3 identity matrix', function() {
            let m = new Matrix([
                [Complex.real(1), Complex.real(0), Complex.real(0)],
                [Complex.real(0), Complex.real(1), Complex.real(0)],
                [Complex.real(0), Complex.real(0), Complex.real(1)]
            ]);
            let det = m.det();
            assert.deepEqual(det, Complex.real(1));
        });

        it('computes the determinant of a 3x3 integer diagonal matrix', function() {
            let m = new Matrix([
                [Complex.real(2), Complex.real(0), Complex.real(0)],
                [Complex.real(0), Complex.real(3), Complex.real(0)],
                [Complex.real(0), Complex.real(0), Complex.real(4)]
            ]);
            let det = m.det();
            assert.deepEqual(det, Complex.real(24));
        });

        it('computes the determinant of a 3x3 integer matrix', function() {
            let m = new Matrix([
                [Complex.real(1), Complex.real(2), Complex.real(4)],
                [Complex.real(3), Complex.real(5), Complex.real(6)],
                [Complex.real(7), Complex.real(8), Complex.real(9)]
            ]);
            let det = m.det();
            assert.deepEqual(det, Complex.real(-17));
        });

        it('computes the determinant of a 3x3 integer Polynomial matrix', function() {
            function polyX(n) {
                return new Polynomial([new Term(Complex.real(n), new Monomial({
                    'x': 1
                }))]);
            }

            function polyX3(n) {
                return new Polynomial([new Term(Complex.real(n), new Monomial({
                    'x': 3
                }))]);
            }
            let m = new Matrix([
                [polyX(1), polyX(2), polyX(4)],
                [polyX(3), polyX(5), polyX(6)],
                [polyX(7), polyX(8), polyX(9)]
            ]);
            let det = m.det();
            assert.deepEqual(det.coefficientList_(), polyX3(-17).coefficientList_());
        });
    });
});

@@ -1,19 +1,19 @@
 const 
-asser
+expec
 t = requ
@@ -24,21 +24,21 @@
 'chai').
-asser
+expec
 t;%0Aconst
@@ -335,32 +335,355 @@
 ', function() %7B%0A
+        it('computes the determinant of a 2x2 matrix', function() %7B%0A            let m = new Matrix(%5B%0A                %5BComplex.real(1), Complex.real(2)%5D,%0A                %5BComplex.real(3), Complex.real(4)%5D%0A            %5D);%0A            let det = m.det();%0A            expect(det).to.deep.equal(new Complex(-2, -0));%0A        %7D);%0A
         it('comp
@@ -1041,38 +1041,42 @@
         
-assert
+expect(det).to
 .deep
-E
+.e
 qual(
-det, 
 Complex.
@@ -1481,38 +1481,42 @@
         
-assert
+expect(det).to
 .deep
-E
+.e
 qual(
-det, 
 Complex.
@@ -1917,30 +1917,34 @@
     
-assert
+expect(det).to
 .deep
-E
+.e
 qual(
-det, 
 Comp
@@ -2652,24 +2652,14 @@
     
-assert.deepEqual
+expect
 (det
@@ -2677,18 +2677,32 @@
 tList_()
-, 
+).to.deep.equal(
 polyX3(-

Add one more test for Matrix.prototype.det