sensei
sensei copied to clipboard
Handle adding course blocks outside of the course page or Course List block
Goal
The Sensei LMS course blocks are only meant to be used either on the course page or inside the Course List / Query Loop block. This is because the blocks need additional context about a course in order to know what to render. For this reason, we need to handle the scenario where course blocks are added anywhere other than the course page or inside the Course List / Query Loop block.
These blocks are:
- View Results
- Course Signup
- Course Progress
- Course Categories
- Course Actions
Acceptance Criteria
Page / Post
Scenario View Results Block - Page / Post (Editor) Given I'm adding a new page or post When I add the View Results block to the page or post Then I should see the message "The View Results block can only be used inside the Course List block."
Scenario Course Signup Block - Page / Post (Editor) Given I'm adding a new page or post When I add the Course Signup block to the page or post Then I should see the message "The Course Signup block can only be used inside the Course List block."
Scenario Course Progress Block - Page / Post (Editor) Given I'm adding a new page or post When I add the Course Progress block to the page or post Then I should see the message "The Course Progress block can only be used inside the Course List block."
Scenario Course Categories Block - Page / Post (Editor) Given I'm adding a new page or post When I add the Course Categories block to the page or post Then I should see the message "The Course Categories block can only be used inside the Course List block."
Scenario Course Actions Block - Page / Post (Editor) Given I'm adding a new page or post When I add the Course Actions block to the page or post Then I should see the message "The Course Actions block can only be used inside the Course List block."
Scenario View Results Block - Page / Post (Frontend) Given I am a logged-in student And I have completed a course When I view the page or post containing the View Results block Then I should not see the View Results block.
Scenario Course Signup Block - Page / Post (Frontend) Given I am a logged-in student And I am not enrolled in a course When I view the page or post containing the Course Signup block Then I should not see the Course Signup block.
Scenario Course Progress Block - Page / Post (Frontend) Given I am a logged-in student And I am enrolled in a course When I view the page or post containing the Course Progress block Then I should not see the Course Progress block.
Scenario Course Categories Block - Page / Post (Frontend) Given I am a logged-in student And I am enrolled in a course When I view the page or post containing the Course Categories block Then I should not see the Course Categories block.
Scenario Course Actions Block - Page / Post (Frontend) Given I am a logged-in student And I am enrolled in a course When I view the page or post containing the Course Actions block Then I should not see the Course Actions block.
Course Page
Scenario View Results Block - Course Page (Editor) Given I'm adding a new course When I add the View Results block to the course page Then I should see the block rendered in the editor.
Scenario Course Signup Block - Course Page (Editor) Given I'm adding a new course When I add the Course Signup block to the course page Then I should see the block rendered in the editor.
Scenario Course Progress Block - Course Page (Editor) Given I'm adding a new course When I add the Course Progress block to the course page Then I should see the block rendered in the editor.
Scenario Course Categories Block - Course Page (Editor) Given I'm adding a new course When I add the Course Categories block to the course page Then I should see the block rendered in the editor.
Scenario Course Actions Block - Course Page (Editor) Given I'm adding a new course When I add the Course Actions block to the course page Then I should see the block rendered in the editor.
Scenario View Results Block - Course Page (Frontend) Given I am a logged-in student And I have completed a course When I view the course page containing the View Results block Then I should see the View Results block.
Scenario Course Signup Block - Course Page (Frontend) Given I am a logged-in student And I am not enrolled in a course When I view the course page containing the Course Signup block Then I should see the Course Signup block.
Scenario Course Progress Block - Course Page (Frontend) Given I am a logged-in student And I am enrolled in a course When I view the course page containing the Course Progress block Then I should see the Course Progress block.
Scenario Course Categories Block - Course Page (Frontend) Given I am a logged-in student And I am enrolled in a course When I view the course page containing the Course Categories block Then I should see the Course Categories block.
Scenario Course Actions Block - Course Page (Frontend) Given I am a logged-in student And I am enrolled in a course When I view the course page containing the Course Actions block Then I should see the Course Actions block.