Skip to content

Commit 7ce0e22

Browse files
Merge pull request #2475 from StateVoicesNational/stage-main-14.1.1
#2475 Stage main 14.1.1
2 parents 680713c + 9adc14f commit 7ce0e22

File tree

11 files changed

+905
-655
lines changed

11 files changed

+905
-655
lines changed

README.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,34 @@ On November 19th, 2023, the repo Spoke was transferred from MoveOn to State Voic
1010

1111
The latest version can be found here: [Release Notes](https://github.com/StateVoicesNational/Spoke/blob/main/docs/RELEASE_NOTES.md)
1212

13-
1413
## Setting up Spoke
1514

16-
17-
The easiest way to get started is with Heroku. You can also learn about Spoke through the [texter](https://youtu.be/EqE1UDvKGco) and [admin](https://youtu.be/PTMykMX8gII) video demos or in the explanation on [how to decide if Spoke is right for you.](docs/EXPLANATION_DECIDING_ON_SPOKE.md)
15+
The easiest way to get started is with Heroku. You can also learn about Spoke through the [texter](https://youtu.be/EqE1UDvKGco) and [admin](https://youtu.be/PTMykMX8gII) video demos or in the explanation on [how to decide if Spoke is right for you.](docs/EXPLANATION_DECIDING_ON_SPOKE.md)
1816

1917
For developers, please see our recommendations for [deploying locally for development](docs/HOWTO_DEVELOPMENT_LOCAL_SETUP.md).
2018

2119
Want to know more?
2220
[Click here to visit the Spoke Documentation microsite!](https://statevoicesnational.github.io/Spoke/)
2321

24-
2522
### Quick Start with Heroku
26-
This version of Spoke suitable for testing and, potentially, for small campaigns. This won't cost any money and will not support production(aka large-scale) usage. It's a great way to practice deploying Spoke or see it in action.
2723

28-
<a href="https://heroku.com/deploy?template=https://github.com/StateVoicesNational/Spoke/tree/v14.1.0">
24+
This version of Spoke suitable for testing and, potentially, for small campaigns. This won't cost any money and will not support production(aka large-scale) usage. It's a great way to practice deploying Spoke or see it in action.
25+
26+
<a href="https://heroku.com/deploy?template=https://github.com/StateVoicesNational/Spoke/tree/v14.1.1">
2927

3028
<img src="https://www.herokucdn.com/deploy/button.svg" alt="Deploy">
3129
</a>
3230

3331
Follow up instructions located [here](docs/HOWTO_HEROKU_DEPLOY.md).
3432

35-
36-
**NOTE:** You can upgrade this deployment later for use in a production setting, but keep in mind you will need to migrate data from any prior campaigns. Thus it is best to upgrade before you start any live campaigns. This will cost ~$75 ($25 dyno + $50 postgres) a month and should be suitable for production level usage for most organizations. We recommend that if you plan to use Spoke at scale that you use [this link to deploy with a production infrastructure from the start!](https://heroku.com/deploy?template=https://github.com/StateVoicesNational/Spoke/tree/heroku-button-paid)
37-
33+
**NOTE:** You can upgrade this deployment later for use in a production setting, but keep in mind you will need to migrate data from any prior campaigns. Thus it is best to upgrade before you start any live campaigns. This will cost ~$75 ($25 dyno + \$50 postgres) a month and should be suitable for production level usage for most organizations. We recommend that if you plan to use Spoke at scale that you use [this link to deploy with a production infrastructure from the start!](https://heroku.com/deploy?template=https://github.com/StateVoicesNational/Spoke/tree/heroku-button-paid)
3834

3935
### Other Options for Production Use
4036

4137
You can also [deploy on AWS Lambda.](docs/HOWTO_DEPLOYING_AWS_LAMBDA.md) which is a lot cheaper than Heroku at scale, but requires considerably more technical knowledge to deploy and maintain. We recommend this option for large scale campaigns with tech resources.
4238

4339
Additional guidance:
40+
4441
- [Choosing a set-up for production](docs/EXPLANATION_CHOOSE_A_SETUP.md)
4542
- [How to hire someone to install Spoke](docs/HOWTO_HIRE_SOMEONE_TO_INSTALL_SPOKE.md)
4643
- [Option for minimalist deployment](docs/HOWTO_MINIMALIST_DEPLOY.md)

__test__/containers/CampaignList.test.js

Lines changed: 69 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,31 @@
33
*/
44
import React from "react";
55
import { mount } from "enzyme";
6-
import { AdminCampaignList } from "../../src/containers/AdminCampaignList";
7-
import { TIMEZONE_SORT } from "../../src/components/AdminCampaignList/SortBy";
6+
import { act } from "react-dom/test-utils";
7+
import {
8+
render,
9+
screen,
10+
waitFor,
11+
cleanup
12+
} from "@testing-library/react";
13+
import userEvent from "@testing-library/user-event";
814
import { StyleSheetTestUtils } from "aphrodite";
915

16+
import { AdminCampaignList } from "../../src/containers/AdminCampaignList";
17+
18+
// https://github.com/Khan/aphrodite/issues/62#issuecomment-267026726
19+
beforeEach(() => {
20+
StyleSheetTestUtils.suppressStyleInjection();
21+
});
22+
afterEach(() => {
23+
StyleSheetTestUtils.clearBufferAndResumeStyleInjection();
24+
cleanup();
25+
});
26+
1027
describe("CampaignList", () => {
1128
const params = {
1229
adminPerms: true,
13-
organizationId: 77
30+
organizationId: "77"
1431
};
1532

1633
const mutations = {
@@ -110,19 +127,21 @@ describe("CampaignList", () => {
110127

111128
describe("Campaign list sorting", () => {
112129
const campaignWithCreator = {
113-
id: 1,
130+
id: "1",
131+
title: "test",
114132
creator: {
115133
displayName: "Lorem Ipsum"
116134
},
117135
completionStats: {},
118136
organization: {
119137
id: 1
120-
}
138+
},
139+
timezone: "US/Eastern"
121140
};
122141

123142
const data = {
124143
organization: {
125-
id: 1,
144+
id: "1",
126145
cacheable: 2,
127146
campaigns: {
128147
campaigns: [campaignWithCreator],
@@ -132,26 +151,58 @@ describe("CampaignList", () => {
132151
total: 1
133152
}
134153
}
135-
}
154+
},
155+
refetch: () => {}
136156
};
137157

138-
test("Timezone column is displayed when timezone is current sort", () => {
158+
test("Timezone column is displayed when timezone is current sort", async () => {
139159
StyleSheetTestUtils.suppressStyleInjection();
140-
const wrapper = mount(
141-
<AdminCampaignList data={data} mutations={mutations} params={params} />
142-
);
143-
wrapper.setState({
144-
sortBy: TIMEZONE_SORT.value
160+
act(() => {
161+
render(
162+
<AdminCampaignList
163+
data={data}
164+
mutations={mutations}
165+
params={params}
166+
/>
167+
);
168+
});
169+
170+
act(() => {
171+
userEvent.click(
172+
screen.getByRole("button", { name: /sort: created, newest/i }),
173+
{ skipHover: true }
174+
);
145175
});
146-
expect(wrapper.containsMatchingElement("Timezone")).toBeTruthy();
176+
177+
act(() => {
178+
userEvent.click(
179+
screen.getByRole("option", { name: /sort: timezone/i }),
180+
{ skipHover: true }
181+
);
182+
});
183+
184+
await waitFor(() =>
185+
expect(
186+
screen.getByRole("columnheader", { name: /timezone/i })
187+
).toBeTruthy()
188+
);
147189
});
148190

149191
test("Timezone column is hidden when it isn't the current sort", () => {
150192
StyleSheetTestUtils.suppressStyleInjection();
151-
const wrapper = mount(
152-
<AdminCampaignList data={data} mutations={mutations} params={params} />
153-
);
154-
expect(wrapper.containsMatchingElement("Timezone")).toBeFalsy();
193+
act(() => {
194+
render(
195+
<AdminCampaignList
196+
data={data}
197+
mutations={mutations}
198+
params={params}
199+
/>
200+
);
201+
});
202+
const timezoneButton = screen.queryByText("columnheader", {
203+
name: /timezone/i
204+
});
205+
expect(timezoneButton).toBeNull();
155206
});
156207
});
157208
});

0 commit comments

Comments
 (0)