-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/web avatar loading #65
Conversation
if (hasCurrentCharacter && props.currentCharacter) { | ||
const assetsExist = checkAgainstCollection(props.collectionData, props.currentCharacter); | ||
if (assetsExist) { | ||
console.log("here! we have a current character!"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leftover dev comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
|
||
export type LoadingErrors = string[]; | ||
|
||
export const parseMMLDescription = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a library function in 3d-web-avatar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
} from "./test-data"; | ||
import { extractNumberFromErrorMessage } from "./test-utils"; | ||
|
||
describe("WebAvatarClient Test Utils", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests could include the parsed character data as well as the errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
}); | ||
}); | ||
|
||
describe("WebAvatarClient MML Parsing", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest simplifying these tests to be an object contents equality check rather than pattern matching. It would be easier to see what the expected outcome was and would be less brittle, even if it were more code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests now include the parsed data compared to the expected outcome through a toStrictEqual
object comparison.
@@ -0,0 +1,108 @@ | |||
export const validMCharacter = ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to include syntactically-invalid strings too. Even if the DOMParser
implementation handles this simply it's good to have defined behaviour in case the implementation changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MarcusLongmuir Can you give me one example of such strings?
@@ -0,0 +1,43 @@ | |||
import { CollectionDataType } from "@mml-io/3d-web-avatar-editor-ui"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function/file (findAssetsInCollection
) should probably be in the @mml-io/3d-web-avatar-editor-ui
package.
It shouldn't be in this package (@mml-io/3d-web-avatar
) because this package doesn't have a dependency on the @mml-io/3d-web-avatar-editor-ui
package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
…ckage to comply with code review
This PR aims to provide avatar loading through MML
m-character
avatar descriptions.What kind of change does your PR introduce? (check at least one)
Does your PR fulfill the following requirements?