Merge pull request #6138 from LLK/release/2021-10-06

[Master] release/2021-10-06
This commit is contained in:
picklesrus 2021-10-07 10:31:51 -04:00 committed by GitHub
commit 04f4eb46ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 402 additions and 758 deletions

View file

@ -1,4 +1,4 @@
Copyright (c) 2015, Massachusetts Institute of Technology
Copyright (c) 2021, Scratch Foundation
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

View file

@ -1 +1 @@
The Scratch trademarks, including the Scratch name, logo, the Scratch Cat, Gobo, Pico, Nano, Tera and Giga graphics (the "Marks"), are property of the Massachusetts Institute of Technology (MIT). Marks may not be used to endorse or promote products derived from this software without specific prior written permission.
The Scratch trademarks, including the Scratch name, logo, the Scratch Cat, Gobo, Pico, Nano, Tera and Giga graphics (the "Marks"), are property of the Scratch Foundation. Marks may not be used to endorse or promote products derived from this software without specific prior written permission.

1090
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -76,7 +76,7 @@
"babel-preset-es2015": "6.22.0",
"babel-preset-react": "6.22.0",
"bowser": "1.9.4",
"chromedriver": "92.0.1",
"chromedriver": "94.0.0",
"classnames": "2.2.5",
"cookie": "0.4.1",
"copy-webpack-plugin": "4.6.0",
@ -130,8 +130,8 @@
"redux-mock-store": "1.5.4",
"redux-thunk": "2.0.1",
"sass-loader": "6.0.6",
"scratch-gui": "0.1.0-prerelease.20210929111256",
"scratch-l10n": "3.14.20210929031524",
"scratch-gui": "0.1.0-prerelease.20211006090606",
"scratch-l10n": "3.14.20211006031531",
"selenium-webdriver": "3.6.0",
"slick-carousel": "1.6.0",
"style-loader": "0.12.3",

View file

@ -29,10 +29,14 @@ let profileUrl = `${rootUrl}/users/${username2}`;
let studioId = process.env.COMMENT_STUDIO_ID || 10005646;
let studioUrl = `${rootUrl}/studios/${studioId}/comments`;
// setup comments to leave
let date = new Date();
let dateString = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ` +
`${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
let buildNumber = process.env.CIRCLE_BUILD_NUM || dateString;
let projectComment = buildNumber + ' project';
let profileComment = buildNumber + ' profile';
let studioComment = buildNumber + ' studio';
if (remote) {
jest.setTimeout(60000);
@ -62,8 +66,8 @@ describe('comment tests', async () => {
// leave the comment
let commentBox = await findByXpath('//textArea[@name="compose-comment"]');
await commentBox.sendKeys(buildNumber);
await findByXpath(`//textarea[contains(text(), "${buildNumber}")]`);
await commentBox.sendKeys(projectComment);
await findByXpath(`//textarea[contains(text(), "${projectComment}")]`);
await clickXpath('//button[@class="button compose-post"]');
// reload the page
@ -85,7 +89,7 @@ describe('comment tests', async () => {
// leave the comment
let commentXpath = await '//form[@id="main-post-form"]/div/textArea';
let commentArea = await findByXpath(commentXpath);
await commentArea.sendKeys(buildNumber);
await commentArea.sendKeys(profileComment);
await clickXpath('//div[@class="button small"]/a[contains(text(), "Post")]');
// reload page
@ -107,8 +111,8 @@ describe('comment tests', async () => {
// leave the comment
let commentBox = await findByXpath('//textArea[@name="compose-comment"]');
await commentBox.sendKeys(buildNumber);
await findByXpath(`//textarea[contains(text(), "${buildNumber}")]`);
await commentBox.sendKeys(studioComment);
await findByXpath(`//textarea[contains(text(), "${studioComment}")]`);
await clickXpath('//button[@class="button compose-post"]');
// reload the page
@ -121,4 +125,50 @@ describe('comment tests', async () => {
let commentVisible = await postedComment.isDisplayed();
await expect(commentVisible).toBe(true);
});
// get notifications
test('get notification badge for comments', async () => {
await signIn(username2, password, driver);
await findByXpath('//span[contains(@class, "profile-name")]');
let messages = await findByXpath('//span[@class = "message-count show"]');
let messagesVisible = await messages.isDisplayed();
await expect(messagesVisible).toBe(true);
});
test('click notifications for comments', async () => {
await signIn(username2, password, driver);
await findByXpath('//span[contains(@class, "profile-name")]');
await clickXpath('//li[@class="link right messages"]');
let messages = await findByXpath('//ul[@class="messages-social-list"]');
let messagesVisible = await messages.isDisplayed();
await expect(messagesVisible).toBe(true);
});
test('project comment visible', async () => {
await signIn(username2, password, driver);
await findByXpath('//span[contains(@class, "profile-name")]');
await driver.get(rootUrl + '/messages');
let projectMessageXpath = '//p[@class="emoji-text mod-comment" ' +
`and contains(text(), "${projectComment}")]`;
let projectMessage = await findByXpath(projectMessageXpath);
let projectMessageVisible = await projectMessage.isDisplayed();
await expect(projectMessageVisible).toBe(true);
});
test('profile comment visible', async () => {
await signIn(username2, password, driver);
await findByXpath('//span[contains(@class, "profile-name")]');
await driver.get(rootUrl + '/messages');
let profileMessageXpath = '//p[@class="emoji-text mod-comment" ' +
`and contains(text(), "${profileComment}")]`;
let profileMessage = await findByXpath(profileMessageXpath);
let profileMessageVisible = await profileMessage.isDisplayed();
await expect(profileMessageVisible).toBe(true);
});
// studio comments do not send a notification
});