Skip to content
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

Teacher Override - Song Filter #25705

Merged
merged 15 commits into from
Nov 5, 2018
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/src/dance/DanceVisualizationColumn.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import ProtectedVisualizationDiv from '../templates/ProtectedVisualizationDiv';
import Radium from "radium";
import {connect} from "react-redux";
import i18n from '@cdo/locale';
import queryString from "query-string";

const GAME_WIDTH = gameLabConstants.GAME_WIDTH;
const GAME_HEIGHT = gameLabConstants.GAME_HEIGHT;
Expand Down Expand Up @@ -67,7 +68,8 @@ class DanceVisualizationColumn extends React.Component {
// userType - 'teacher', assumed age > 13. 'student', age > 13.
// 'student_y', age < 13. 'unknown', signed out users
const signedInOver13 = this.props.userType === 'teacher' || this.props.userType === 'student';
const filterOff = signedInOver13 || sessionStorage.getItem('anon_over13');
const teacherOverride = queryString.parse(window.location.search).songfilter === 'on';
const filterOff = (signedInOver13 || sessionStorage.getItem('anon_over13')) && !teacherOverride;

return (
<span>
Expand Down
Binary file modified dashboard/db/schema_cache.dump
Binary file not shown.
70 changes: 70 additions & 0 deletions dashboard/test/ui/features/dance/age_filter.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
Feature: Dance Lab Age Filter
Scenario: Song selector is visible and doesn't display pg13 songs for age < 13
Given I create a young student named "Harry"
And I am on "http://studio.code.org/s/allthethings/stage/37/puzzle/1?noautoplay=true"
And I rotate to landscape
And I wait for the page to fully load
And I wait for 3 seconds
And I wait until I don't see selector "#p5_loading"
And I close the instructions overlay if it exists
Then element "#runButton" is visible
And element "#song_selector" is visible
#Local PG-13 option should not be visible after filter in any environment
And I do not see "synthesize" option in the dropdown "#song_selector"
#Test PG-13 option should not be visible after filter in any environment
And I do not see "shapeofyou_edsheeran" option in the dropdown "#song_selector"

Scenario: Song selector is visible and displays all songs for age > 13 and teacher flag turns filter on
Given I create a student named "Ron"
And I am on "http://studio.code.org/s/allthethings/stage/37/puzzle/1?noautoplay=true"
And I rotate to landscape
And I wait for the page to fully load
And I wait for 3 seconds
And I wait until I don't see selector "#p5_loading"
And I close the instructions overlay if it exists
Then element "#runButton" is visible
And element "#song_selector" is visible
#Jazzy_beats is available on local and isawthesign is available on test
And I see option "jazzy_beats" or "isawthesign_aceofbase" in the dropdown "#song_selector"

Then I am on "http://studio.code.org/s/allthethings/stage/37/puzzle/1?noautoplay=true&songfilter=on"
And I wait for the page to fully load
And I wait until I don't see selector "#p5_loading"
#Local PG-13 option should not be visible after filter in any environment
And I do not see "synthesize" option in the dropdown "#song_selector"
#Test PG-13 option should not be visible after filter in any environment
And I do not see "shapeofyou_edsheeran" option in the dropdown "#song_selector"

Scenario: Selecting <13 in age dialog turns filter on
Given I am on "http://studio.code.org/s/allthethings/stage/37/puzzle/1?noautoplay=true"
And I rotate to landscape
And I wait for the page to fully load
And I wait for 3 seconds
And I wait until I don't see selector "#p5_loading"
And element ".signInOrAgeDialog" is visible
And I select the "10" option in dropdown "uitest-age-selector"
And I click selector "#uitest-submit-age"

And I close the instructions overlay if it exists
Then element "#runButton" is visible
And element "#song_selector" is visible
#Local PG-13 option should not be visible after filter in any environment
And I do not see "synthesize" option in the dropdown "#song_selector"
#Test PG-13 option should not be visible after filter in any environment
And I do not see "shapeofyou_edsheeran" option in the dropdown "#song_selector"

Scenario: Selecting 13 in age dialog turns filter off
Given I am on "http://studio.code.org/s/allthethings/stage/37/puzzle/1?noautoplay=true"
And I rotate to landscape
And I wait for the page to fully load
And I wait for 3 seconds
And I wait until I don't see selector "#p5_loading"
And element ".signInOrAgeDialog" is visible
And I select the "13" option in dropdown "uitest-age-selector"
And I click selector "#uitest-submit-age"

And I close the instructions overlay if it exists
Then element "#runButton" is visible
And element "#song_selector" is visible
#Jazzy_beats is available on local and isawthesign is available on test
And I see option "jazzy_beats" or "isawthesign_aceofbase" in the dropdown "#song_selector"
64 changes: 0 additions & 64 deletions dashboard/test/ui/features/spritelab/dancelab.feature
Original file line number Diff line number Diff line change
@@ -1,69 +1,5 @@
@no_older_chrome
Feature: Dance Lab
Scenario: Song selector is visible and doesn't display pg13 songs for age < 13
Given I create a young student named "Harry"
And I am on "http://studio.code.org/s/allthethings/stage/37/puzzle/1?noautoplay=true"
And I rotate to landscape
And I wait for the page to fully load
And I wait for 3 seconds
And I wait until I don't see selector "#p5_loading"
And I close the instructions overlay if it exists
Then element "#runButton" is visible
And element "#song_selector" is visible
#Local PG-13 option should not be visible after filter in any environment
And I do not see "synthesize" option in the dropdown "#song_selector"
#Test PG-13 option should not be visible after filter in any environment
And I do not see "shapeofyou_edsheeran" option in the dropdown "#song_selector"
And I sign out

Scenario: Song selector is visible and displays all songs for age > 13
Given I create a student named "Ron"
And I am on "http://studio.code.org/s/allthethings/stage/37/puzzle/1?noautoplay=true"
And I rotate to landscape
And I wait for the page to fully load
And I wait for 3 seconds
And I wait until I don't see selector "#p5_loading"
And I close the instructions overlay if it exists
Then element "#runButton" is visible
And element "#song_selector" is visible
#Jazzy_beats is available on local and isawthesign is available on test
And I see option "jazzy_beats" or "isawthesign_aceofbase" in the dropdown "#song_selector"
And I sign out

Scenario: Selecting <13 in age dialog turns filter on
Given I am on "http://studio.code.org/s/allthethings/stage/37/puzzle/1?noautoplay=true"
And I rotate to landscape
And I wait for the page to fully load
And I wait for 3 seconds
And I wait until I don't see selector "#p5_loading"
And element ".signInOrAgeDialog" is visible
And I select the "10" option in dropdown "uitest-age-selector"
And I click selector "#uitest-submit-age"

And I close the instructions overlay if it exists
Then element "#runButton" is visible
And element "#song_selector" is visible
#Local PG-13 option should not be visible after filter in any environment
And I do not see "synthesize" option in the dropdown "#song_selector"
#Test PG-13 option should not be visible after filter in any environment
And I do not see "shapeofyou_edsheeran" option in the dropdown "#song_selector"

Scenario: Selecting 13 in age dialog turns filter off
Given I am on "http://studio.code.org/s/allthethings/stage/37/puzzle/1?noautoplay=true"
And I rotate to landscape
And I wait for the page to fully load
And I wait for 3 seconds
And I wait until I don't see selector "#p5_loading"
And element ".signInOrAgeDialog" is visible
And I select the "13" option in dropdown "uitest-age-selector"
And I click selector "#uitest-submit-age"

And I close the instructions overlay if it exists
Then element "#runButton" is visible
And element "#song_selector" is visible
#Jazzy_beats is available on local and isawthesign is available on test
And I see option "jazzy_beats" or "isawthesign_aceofbase" in the dropdown "#song_selector"

# This test requires cloudfront.
@no_circle
@no_firefox
Expand Down
10 changes: 10 additions & 0 deletions node_modules/.yarn-integrity

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/@code-dot-org/dance-party

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.