░▒▓████████████████████████████████▓▒░ ░▒▓█ ▓▒░ ░▒▓█ ~ S W A M P ~ ▓▒░ ░▒▓█ ▓▒░ ░▒▓████████████████████████████████▓▒░
pplmvsvm
LOCATION:
/var/www/canvas/spec/javascripts/jsx/gradebook-history/actions
☗ ROOT
↻ REFRESH
✎ CARVE FLESH
EDITING: SearchResultsActionsSpec.js
/* * Copyright (C) 2017 - present Instructure, Inc. * * This file is part of Canvas. * * Canvas is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free * Software Foundation, version 3 of the License. * * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more * details. * * You should have received a copy of the GNU Affero General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ import Fixtures from '../Fixtures' import GradebookHistoryStore from 'ui/features/gradebook_history/react/store/GradebookHistoryStore' import * as HistoryActions from 'ui/features/gradebook_history/react/actions/HistoryActions' import HistoryApi from 'ui/features/gradebook_history/react/api/HistoryApi' import * as SearchResultsActions from 'ui/features/gradebook_history/react/actions/SearchResultsActions' QUnit.module('SearchResultsActionsSpec getHistoryNextPage', { setup() { this.response = Fixtures.historyResponse() this.getNextPageStub = sandbox .stub(HistoryApi, 'getNextPage') .returns(Promise.resolve(this.response)) this.dispatchSpy = sandbox.spy(GradebookHistoryStore, 'dispatch') }, }) test('dispatches fetchHistoryNextPageStart', function () { const fetchSpy = sandbox.spy(HistoryActions, 'fetchHistoryNextPageStart') const promise = this.dispatchSpy(SearchResultsActions.getHistoryNextPage('http://example.com')) return promise.then(() => { strictEqual(fetchSpy.callCount, 1) }) }) test('dispatches fetchHistoryNextPageSuccess with response data and headers on success', function () { const fetchSpy = sandbox.spy(HistoryActions, 'fetchHistoryNextPageSuccess') const promise = this.dispatchSpy(SearchResultsActions.getHistoryNextPage('http://example.com')) return promise.then(() => { strictEqual(fetchSpy.callCount, 1) deepEqual(fetchSpy.firstCall.args[0], this.response.data) deepEqual(fetchSpy.firstCall.args[1], this.response.headers) }) }) test('dispatches fetchHistoryNextPageFailure on failure', function () { this.getNextPageStub.returns(Promise.reject(new Error('FAIL'))) const fetchSpy = sandbox.spy(HistoryActions, 'fetchHistoryNextPageFailure') const promise = this.dispatchSpy(SearchResultsActions.getHistoryNextPage('http://example.com')) return promise.then(() => { strictEqual(fetchSpy.callCount, 1) fetchSpy.restore() }) })
CANCEL
Name
Type
Size
Modified
Actions
↩ ..
DIR
—
—
📄 HistoryActionsSpec.js
JS
8.1 KB
2023-09-24 03:36
EDIT
📄 SearchFormActionsSpec.js
JS
9.9 KB
2023-09-24 03:36
EDIT
📄 SearchResultsActionsSpec.js
JS
2.6 KB
2023-09-24 03:36
EDIT