@@ -669,7 +669,7 @@ describe('AtlasUserData', function () {
669669 getResourceUrlStub
670670 . onFirstCall ( )
671671 . resolves (
672- 'cluster-connection.cloud.mongodb.com/FavoriteQueries/test-org/test-proj'
672+ 'cluster-connection.cloud.mongodb.com/FavoriteQueries/test-org/test-proj/test-id '
673673 )
674674 . onSecondCall ( )
675675 . resolves (
@@ -688,7 +688,7 @@ describe('AtlasUserData', function () {
688688
689689 const [ getUrl , getOptions ] = authenticatedFetchStub . firstCall . args ;
690690 expect ( getUrl ) . to . equal (
691- 'cluster-connection.cloud.mongodb.com/FavoriteQueries/test-org/test-proj'
691+ 'cluster-connection.cloud.mongodb.com/FavoriteQueries/test-org/test-proj/test-id '
692692 ) ;
693693 expect ( getOptions . method ) . to . equal ( 'GET' ) ;
694694
@@ -700,7 +700,7 @@ describe('AtlasUserData', function () {
700700 expect ( putOptions . headers [ 'Content-Type' ] ) . to . equal ( 'application/json' ) ;
701701 } ) ;
702702
703- it ( 'returns false when authenticatedFetch throws an error' , async function ( ) {
703+ it ( 'throws error when authenticatedFetch throws an error' , async function ( ) {
704704 const getResponse = {
705705 data : JSON . stringify ( { name : 'Original Name' , hasDarkMode : true } ) ,
706706 } ;
@@ -714,7 +714,7 @@ describe('AtlasUserData', function () {
714714 getResourceUrlStub
715715 . onFirstCall ( )
716716 . resolves (
717- 'cluster-connection.cloud.mongodb.com/FavoriteQueries/test-org/test-proj'
717+ 'cluster-connection.cloud.mongodb.com/FavoriteQueries/test-org/test-proj/test-id '
718718 )
719719 . onSecondCall ( )
720720 . resolves (
@@ -723,10 +723,15 @@ describe('AtlasUserData', function () {
723723
724724 const userData = getAtlasUserData ( ) ;
725725
726- const result = await userData . updateAttributes ( 'test-id' , {
727- name : 'Updated' ,
728- } ) ;
729- expect ( result ) . equals ( false ) ;
726+ try {
727+ await userData . updateAttributes ( 'test-id' , {
728+ name : 'Updated' ,
729+ } ) ;
730+ expect . fail ( 'Expected method to throw an error' ) ;
731+ } catch ( error ) {
732+ expect ( error ) . to . be . instanceOf ( Error ) ;
733+ expect ( ( error as Error ) . message ) . to . equal ( 'HTTP 400: Bad Request' ) ;
734+ }
730735 } ) ;
731736
732737 it ( 'uses custom serializer for request body' , async function ( ) {
0 commit comments