@ -37,8 +37,13 @@ import type {
UnexpectedResourceError ,
UnexpectedResourceError ,
UpdateDefaultGraphSuccess ,
UpdateDefaultGraphSuccess ,
UpdateSuccess ,
UpdateSuccess ,
ConnectedLdoDataset ,
} from "@ldo/connected" ;
import {
changeData ,
commitData ,
ConnectedLdoTransactionDataset ,
} from "@ldo/connected" ;
} from "@ldo/connected" ;
import { changeData , commitData , ConnectedLdoDataset } from "@ldo/connected" ;
import { getStorageFromWebId } from "../src/getStorageFromWebId" ;
import { getStorageFromWebId } from "../src/getStorageFromWebId" ;
const TEST_CONTAINER_SLUG = "test_ldo/" ;
const TEST_CONTAINER_SLUG = "test_ldo/" ;
@ -131,7 +136,7 @@ async function testRequestLoads<ReturnVal>(
( async ( ) = > {
( async ( ) = > {
Object . entries ( allLoadingValues ) . forEach ( ( [ key , value ] ) = > {
Object . entries ( allLoadingValues ) . forEach ( ( [ key , value ] ) = > {
if (
if (
loadingResource . type === "c ontainer" &&
loadingResource . type === "SolidC ontainer" &&
( key === "isUploading" || key === "isUpdating" )
( key === "isUploading" || key === "isUpdating" )
) {
) {
return ;
return ;
@ -602,8 +607,8 @@ describe("Integration", () => {
it ( "Finds the root container" , async ( ) = > {
it ( "Finds the root container" , async ( ) = > {
const resource = solidLdoDataset . getResource ( SAMPLE2_BINARY_URI ) ;
const resource = solidLdoDataset . getResource ( SAMPLE2_BINARY_URI ) ;
const result = await resource . getRootContainer ( ) ;
const result = await resource . getRootContainer ( ) ;
expect ( result . type ) . toBe ( "c ontainer" ) ;
expect ( result . type ) . toBe ( "SolidC ontainer" ) ;
if ( result . type !== "c ontainer" ) return ;
if ( result . type !== "SolidC ontainer" ) return ;
expect ( result . uri ) . toBe ( ROOT_CONTAINER ) ;
expect ( result . uri ) . toBe ( ROOT_CONTAINER ) ;
expect ( result . isRootContainer ( ) ) . toBe ( true ) ;
expect ( result . isRootContainer ( ) ) . toBe ( true ) ;
} ) ;
} ) ;
@ -694,6 +699,7 @@ describe("Integration", () => {
SAMPLE_PROFILE_URI ,
SAMPLE_PROFILE_URI ,
solidLdoDataset ,
solidLdoDataset ,
) ;
) ;
console . log ( result ) ;
expect ( result . type ) . toBe ( "getStorageContainerFromWebIdSuccess" ) ;
expect ( result . type ) . toBe ( "getStorageContainerFromWebIdSuccess" ) ;
const realResult = result as GetStorageContainerFromWebIdSuccess ;
const realResult = result as GetStorageContainerFromWebIdSuccess ;
expect ( realResult . storageContainers . length ) . toBe ( 2 ) ;
expect ( realResult . storageContainers . length ) . toBe ( 2 ) ;
@ -1308,7 +1314,7 @@ describe("Integration", () => {
it ( "allows a transaction on a transaction" , ( ) = > {
it ( "allows a transaction on a transaction" , ( ) = > {
const transaction = solidLdoDataset . startTransaction ( ) ;
const transaction = solidLdoDataset . startTransaction ( ) ;
const transaction2 = transaction . startTransaction ( ) ;
const transaction2 = transaction . startTransaction ( ) ;
expect ( transaction2 ) . toBeInstanceOf ( ConnectedLdoDataset ) ;
expect ( transaction2 ) . toBeInstanceOf ( ConnectedLdoTransaction Dataset ) ;
} ) ;
} ) ;
/ * *
/ * *
@ -1933,7 +1939,7 @@ describe("Integration", () => {
expect (
expect (
( wacResult as NoncompliantPodError < SolidLeaf | SolidContainer > ) . message ,
( wacResult as NoncompliantPodError < SolidLeaf | SolidContainer > ) . message ,
) . toBe (
) . toBe (
` Response from card.ac l is not compliant with the Solid Specification: Request returned noncompliant turtle: Unexpected "BAD" on line 1. \ nBAD TURTLE ` ,
` Response from http://localhost:3001/test_ldo/sample.tt l is not compliant with the Solid Specification: Request returned noncompliant turtle: Unexpected "BAD" on line 1. \ nBAD TURTLE ` ,
) ;
) ;
} ) ;
} ) ;