Skip to content

Commit b8f76e2

Browse files
Merge branch 'staging' of github.com:code-dot-org/code-dot-org into staging
2 parents 70511e7 + 58f4d93 commit b8f76e2

File tree

7 files changed

+42
-8
lines changed

7 files changed

+42
-8
lines changed

apps/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@
227227
"react-dom-confetti": "^0.0.8",
228228
"react-hot-loader": "^1.3.1",
229229
"selectize": "^0.12.4",
230+
"wgxpath": "^1.2.0",
230231
"whatwg-fetch": "^2.0.3"
231232
}
232233
}

apps/src/polyfills.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* "Pointer Events Polyfill" to support pointer events on Safari
33
*/
44
import 'pepjs';
5+
import wickedGoodXpath from 'wgxpath';
56

67
/**
78
* A low-performance polyfill for toBlob based on toDataURL. Adapted from:
@@ -32,3 +33,10 @@ if (SVGElement.prototype.getElementsByClassName === undefined) {
3233
return this.querySelectorAll('.' + className);
3334
};
3435
}
36+
37+
/**
38+
* Polyfill for document.evaluate for IE
39+
*/
40+
if (!document.evaluate) {
41+
wickedGoodXpath.install(window);
42+
}

apps/yarn.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12242,6 +12242,10 @@ websocket-extensions@>=0.1.1:
1224212242
version "0.1.1"
1224312243
resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.1.tgz#76899499c184b6ef754377c2dbb0cd6cb55d29e7"
1224412244

12245+
wgxpath@^1.2.0:
12246+
version "1.2.0"
12247+
resolved "https://registry.yarnpkg.com/wgxpath/-/wgxpath-1.2.0.tgz#a33e4e0f86e68e074d95d50a6e533d64938f432a"
12248+
1224512249
whatwg-fetch@>=0.10.0, whatwg-fetch@^2.0.4:
1224612250
version "2.0.4"
1224712251
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f"

dashboard/test/ui/features/projects/public_project_gallery_project_validator.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,6 @@ Scenario: Can See App Lab/Game Lab View More Links
7272
Then I wait until element "#public-gallery" is visible
7373
Then I wait until element ".ui-project-app-type-area" is in the DOM
7474
And the project gallery contains 7 project types
75+
And the project gallery contains 7 view more links
7576
And element ".ui-project-app-type-area:eq(4)" contains text "View more App Lab projects"
7677
And element ".ui-project-app-type-area:eq(5)" contains text "View more Game Lab projects"

dashboard/test/ui/features/projects/public_project_gallery_signed_out.feature

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,7 @@ Scenario: Public Gallery Shows Expected Project Types
1919
And element ".ui-project-app-type-area:eq(5)" contains text "Game Lab"
2020
And element ".ui-project-app-type-area:eq(6)" contains text "Pre-reader"
2121

22-
Scenario: View More Links Do NOT Show for App Lab and Game Lab
22+
Scenario: View More Links for App Lab and Game Lab Based on DCDO
2323
Then I wait until element ".ui-project-app-type-area" is in the DOM
2424
And the project gallery contains 7 project types
25-
And the project gallery contains 5 view more links
26-
And element ".ui-project-app-type-area:eq(0)" contains text "View more Play Lab projects"
27-
And element ".ui-project-app-type-area:eq(4)" contains text "App Lab"
28-
And element ".ui-project-app-type-area:eq(4)" does not contain text "View more"
29-
And element ".ui-project-app-type-area:eq(5)" contains text "Game Lab"
30-
And element ".ui-project-app-type-area:eq(5)" does not contain text "View more"
25+
And I confirm correct visibility of view more links

dashboard/test/ui/features/spritelab/spritelab.feature

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@no_ie
21
Feature: Sprite Lab
32

43
Background:

dashboard/test/ui/features/step_definitions/projects.rb

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
require 'dynamic_config/dcdo'
2+
3+
# The "view more" links in the public project gallery for App Lab and Game Lab
4+
# are controlled by DCDO so we can quickly hide them if there are
5+
# inappropriate projects. This lets us test "view more" link
6+
# visibility without updating the tests every time we toggle the flag.
7+
And(/^I confirm correct visibility of view more links$/) do
8+
dcdo_flag = DCDO.get('image_moderation', {})['limited_project_gallery']
9+
hidden_view_more_links = dcdo_flag.nil? ? true : dcdo_flag
10+
if hidden_view_more_links
11+
steps %Q{
12+
And the project gallery contains 5 view more links
13+
And element ".ui-project-app-type-area:eq(4)" contains text "App Lab"
14+
And element ".ui-project-app-type-area:eq(4)" does not contain text "View more"
15+
And element ".ui-project-app-type-area:eq(5)" contains text "Game Lab"
16+
And element ".ui-project-app-type-area:eq(5)" does not contain text "View more"
17+
}
18+
else
19+
steps %Q{
20+
And the project gallery contains 7 view more links
21+
And element ".ui-project-app-type-area:eq(4)" contains text "View more App Lab projects"
22+
And element ".ui-project-app-type-area:eq(5)" contains text "View more Game Lab projects"
23+
}
24+
end
25+
end
26+
127
And(/^I give user "([^"]*)" project validator permission$/) do |name|
228
require_rails_env
329
user = User.find_by_email_or_hashed_email(@users[name][:email])

0 commit comments

Comments
 (0)