Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/view/screens/Loading/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const Loading: FC<Screens.Loading> = (
const startTime = performance.now();
// Collate data from 'playerChoice' trials
consola.info(`Collating data...`);
const dataCollection = jsPsych.data
const collection: Dataframe[] = jsPsych.data
.get()
.filter({
display: "playerChoice",
Expand All @@ -89,15 +89,15 @@ const Loading: FC<Screens.Loading> = (

consola.debug(
`'dataCollection' containing trials with 'display' = 'playerChoice':`,
dataCollection
collection
);

// Format the responses to be sent to the server
const requestResponses = [];
for (const row of dataCollection) {
requestResponses.push({
const requestData = [];
for (const row of collection) {
requestData.push({
ID: "NA",
Trial: row.trial,
Trial: row.trial_number, // INT-82: Rename from `trial` to `trial_number`
ppt1: row.playerPoints_option1,
par1: row.partnerPoints_option1,
ppt2: row.playerPoints_option2,
Expand All @@ -106,11 +106,11 @@ const Loading: FC<Screens.Loading> = (
Phase: 1,
});
}
consola.debug(`Request content 'requestResponses':`, requestResponses);
consola.debug(`Request data 'requestData':`, requestData);

// Launch model computation
consola.info(`Running model computation...`);
const response = await window.Compute.submit(requestResponses, false); // INT-80: Should be `false` in production
const response = await window.Compute.submit(requestData, false); // INT-80: Should be `false` in production

// Parse and store the JSON content
try {
Expand Down
6 changes: 3 additions & 3 deletions src/view/screens/Questionnaires/Status/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,15 +218,15 @@ const Status: FC<Screens.Status> = (
justify={"center"}
align={"center"}
gap={"small"}
style={{ maxWidth: "70%", margin: "auto" }}
style={{ maxWidth: "72%", margin: "auto" }}
animation={["fadeIn"]}
>
<Heading level={3} margin="small" fill>
Please answer the following questions:
</Heading>

<Paragraph margin="small" size="large" fill>
Across all social media accounts, how many followers do you have?
Across all social media accounts, how many <b>followers</b> do you have?
</Paragraph>
<Box
pad={"xsmall"}
Expand All @@ -243,7 +243,7 @@ const Status: FC<Screens.Status> = (
</Box>

<Paragraph margin="small" size="large" fill>
Across all social media accounts, how many people are following you?
Across all social media accounts, how many people are you <b>following</b>?
</Paragraph>
<Box
pad={"xsmall"}
Expand Down
16 changes: 1 addition & 15 deletions test/view/screens/Status.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,5 @@ test("loads and displays Status screen page 2", async () => {
continueButton.click();
});

await waitFor(() =>
screen.queryByText(
"Across all social media accounts, how many followers do you have?"
)
);
expect(
screen.queryByText(
"Across all social media accounts, how many followers do you have?"
)
).not.toBeNull();
expect(
screen.queryByText(
"Across all social media accounts, how many people are following you?"
)
).not.toBeNull();
expect(screen.queryAllByText(/Across all social media accounts,/i)).toHaveLength(2);
});