1
0
mirror of https://github.com/ohwgiles/laminar.git synced 2026-03-02 03:40:21 +00:00

refactor: remove run page json type hack

this hack tried to avoid sending unnecessary data to the frontend,
but it was more trouble than it's worth
This commit is contained in:
Oliver Giles
2019-11-01 07:27:34 +02:00
parent 39ca7e86cf
commit ba472711be
5 changed files with 42 additions and 19 deletions

View File

@@ -73,3 +73,31 @@ TEST_F(LaminarFixture, JobNotifyHomePage) {
EXPECT_STREQ("foo", job_completed["data"]["name"].GetString());
}
TEST_F(LaminarFixture, OnlyRelevantNotifications) {
defineJob("job1", "true");
defineJob("job2", "true");
auto esHome = eventSource("/");
auto esJobs = eventSource("/jobs");
auto es1Job = eventSource("/jobs/job1");
auto es2Job = eventSource("/jobs/job2");
auto es1Run = eventSource("/jobs/job1/1");
auto es2Run = eventSource("/jobs/job2/1");
auto req1 = client().runRequest();
req1.setJobName("job1");
ASSERT_EQ(LaminarCi::JobResult::SUCCESS, req1.send().wait(ioContext.waitScope).getResult());
auto req2 = client().runRequest();
req2.setJobName("job2");
ASSERT_EQ(LaminarCi::JobResult::SUCCESS, req2.send().wait(ioContext.waitScope).getResult());
ioContext.waitScope.poll();
EXPECT_EQ(7, esHome->messages().size());
EXPECT_EQ(7, esJobs->messages().size());
EXPECT_EQ(4, es1Job->messages().size());
EXPECT_EQ(4, es2Job->messages().size());
EXPECT_EQ(4, es1Run->messages().size());
EXPECT_EQ(4, es2Run->messages().size());
}