@@ -1624,7 +1624,7 @@ describe('e2e record', () => {
1624
1624
} ,
1625
1625
} ) )
1626
1626
1627
- it ( 'fails on request socket errors after retrying' , function ( ) {
1627
+ it ( 'fails after retrying' , function ( ) {
1628
1628
process . env . API_RETRY_INTERVALS = '1000'
1629
1629
1630
1630
return systemTests . exec ( this , {
@@ -1642,7 +1642,7 @@ describe('e2e record', () => {
1642
1642
} )
1643
1643
} )
1644
1644
1645
- describe ( '[F1] status code errors with empty body' , ( ) => {
1645
+ describe ( '[F1] 500 status code errors with empty body' , ( ) => {
1646
1646
setupStubbedServer ( createRoutes ( {
1647
1647
sendPreflight : {
1648
1648
res ( req , res ) {
@@ -1651,7 +1651,7 @@ describe('e2e record', () => {
1651
1651
} ,
1652
1652
} ) )
1653
1653
1654
- it ( 'fails on 500 status codes after retrying' , function ( ) {
1654
+ it ( 'fails after retrying' , function ( ) {
1655
1655
process . env . API_RETRY_INTERVALS = '1000'
1656
1656
1657
1657
return systemTests . exec ( this , {
@@ -1669,7 +1669,7 @@ describe('e2e record', () => {
1669
1669
} )
1670
1670
} )
1671
1671
1672
- describe ( '[F1] status code errors with body' , ( ) => {
1672
+ describe ( '[F1] 500 status code errors with body' , ( ) => {
1673
1673
setupStubbedServer ( createRoutes ( {
1674
1674
sendPreflight : {
1675
1675
res ( req , res ) {
@@ -1680,7 +1680,7 @@ describe('e2e record', () => {
1680
1680
} ,
1681
1681
} ) )
1682
1682
1683
- it ( 'fails on 500 status codes after retrying' , function ( ) {
1683
+ it ( 'fails after retrying' , function ( ) {
1684
1684
process . env . API_RETRY_INTERVALS = '1000'
1685
1685
1686
1686
return systemTests . exec ( this , {
@@ -1698,7 +1698,7 @@ describe('e2e record', () => {
1698
1698
} )
1699
1699
} )
1700
1700
1701
- describe ( '[F2]' , ( ) => {
1701
+ describe ( '[F2] 404 status code with JSON body ' , ( ) => {
1702
1702
setupStubbedServer ( createRoutes ( {
1703
1703
sendPreflight : {
1704
1704
res ( req , res ) {
@@ -1709,7 +1709,7 @@ describe('e2e record', () => {
1709
1709
} ,
1710
1710
} ) )
1711
1711
1712
- it ( 'fails on 404 status codes with JSON body without retrying' , function ( ) {
1712
+ it ( 'fails without retrying' , function ( ) {
1713
1713
process . env . API_RETRY_INTERVALS = '1000'
1714
1714
1715
1715
return systemTests . exec ( this , {
@@ -1727,7 +1727,7 @@ describe('e2e record', () => {
1727
1727
} )
1728
1728
} )
1729
1729
1730
- describe ( '[F2]' , ( ) => {
1730
+ describe ( '[F2] 404 status code with empty body ' , ( ) => {
1731
1731
setupStubbedServer ( createRoutes ( {
1732
1732
sendPreflight : {
1733
1733
res ( req , res ) {
@@ -1736,7 +1736,7 @@ describe('e2e record', () => {
1736
1736
} ,
1737
1737
} ) )
1738
1738
1739
- it ( 'fails on 404 status codes without JSON body without retrying' , function ( ) {
1739
+ it ( 'fails without retrying' , function ( ) {
1740
1740
process . env . API_RETRY_INTERVALS = '1000'
1741
1741
1742
1742
return systemTests . exec ( this , {
@@ -1754,24 +1754,18 @@ describe('e2e record', () => {
1754
1754
} )
1755
1755
} )
1756
1756
1757
- describe ( '[F3]' , ( ) => {
1757
+ describe ( '[F3] 422 status code with invalid decryption ' , ( ) => {
1758
1758
setupStubbedServer ( createRoutes ( {
1759
1759
sendPreflight : {
1760
1760
res : async ( req , res ) => {
1761
- return res . status ( 412 ) . json ( await encryptBody ( req , res , {
1762
- message : 'Recording is not working' ,
1763
- errors : [
1764
- 'attempted to send invalid data' ,
1765
- ] ,
1766
- object : {
1767
- projectId : 'cy12345' ,
1768
- } ,
1769
- } ) )
1761
+ return res . status ( 422 ) . json ( {
1762
+ message : 'something broke' ,
1763
+ } )
1770
1764
} ,
1771
1765
} ,
1772
1766
} ) )
1773
1767
1774
- it ( 'fails on 412 status codes when request is invalid ' , function ( ) {
1768
+ it ( 'fails without retrying ' , function ( ) {
1775
1769
process . env . API_RETRY_INTERVALS = '1000'
1776
1770
1777
1771
return systemTests . exec ( this , {
@@ -1789,18 +1783,18 @@ describe('e2e record', () => {
1789
1783
} )
1790
1784
} )
1791
1785
1792
- describe ( '[F4] ' , ( ) => {
1786
+ describe ( '[F3] 201 status code with invalid decryption ' , ( ) => {
1793
1787
setupStubbedServer ( createRoutes ( {
1794
1788
sendPreflight : {
1795
- res : async ( req , res ) => {
1796
- return res . status ( 422 ) . json ( {
1797
- message : 'something broke' ,
1798
- } )
1789
+ res ( req , res ) {
1790
+ return res
1791
+ . status ( 201 )
1792
+ . json ( { data : 'very encrypted and secure string' } )
1799
1793
} ,
1800
1794
} ,
1801
1795
} ) )
1802
1796
1803
- it ( 'fails on 422 status codes even when encryption is off ' , function ( ) {
1797
+ it ( 'fails without retrying ' , function ( ) {
1804
1798
process . env . API_RETRY_INTERVALS = '1000'
1805
1799
1806
1800
return systemTests . exec ( this , {
@@ -1818,18 +1812,16 @@ describe('e2e record', () => {
1818
1812
} )
1819
1813
} )
1820
1814
1821
- describe ( '[F5] ' , ( ) => {
1815
+ describe ( '[F3] 200 status code with empty body ' , ( ) => {
1822
1816
setupStubbedServer ( createRoutes ( {
1823
1817
sendPreflight : {
1824
1818
res ( req , res ) {
1825
- return res
1826
- . status ( 201 )
1827
- . json ( { data : 'very encrypted and secure string' } )
1819
+ return res . sendStatus ( 200 )
1828
1820
} ,
1829
1821
} ,
1830
1822
} ) )
1831
1823
1832
- it ( 'fails on OK status codes with invalid unencrypted data without retrying' , function ( ) {
1824
+ it ( 'fails without retrying' , function ( ) {
1833
1825
process . env . API_RETRY_INTERVALS = '1000'
1834
1826
1835
1827
return systemTests . exec ( this , {
@@ -1847,16 +1839,24 @@ describe('e2e record', () => {
1847
1839
} )
1848
1840
} )
1849
1841
1850
- describe ( '[F6] ' , ( ) => {
1842
+ describe ( '[F4] 412 status code with valid decryption ' , ( ) => {
1851
1843
setupStubbedServer ( createRoutes ( {
1852
1844
sendPreflight : {
1853
- res ( req , res ) {
1854
- return res . sendStatus ( 200 )
1845
+ res : async ( req , res ) => {
1846
+ return res . status ( 412 ) . json ( await encryptBody ( req , res , {
1847
+ message : 'Recording is not working' ,
1848
+ errors : [
1849
+ 'attempted to send invalid data' ,
1850
+ ] ,
1851
+ object : {
1852
+ projectId : 'cy12345' ,
1853
+ } ,
1854
+ } ) )
1855
1855
} ,
1856
1856
} ,
1857
1857
} ) )
1858
1858
1859
- it ( 'fails on OK status codes with empty body without retrying' , function ( ) {
1859
+ it ( 'fails without retrying' , function ( ) {
1860
1860
process . env . API_RETRY_INTERVALS = '1000'
1861
1861
1862
1862
return systemTests . exec ( this , {
0 commit comments