Template:Infobox legislative election/testcases

{{Testcases}}

Ongoing yes / no

=Yes=

==Show last election==

{{Testcase table

| election_name = British general election, 2015

| country = United Kingdom

| previous_election = 2010

| next_election = 2017

| election_date = 7 May 2015

| ongoing = yes

| outgoing_members = List of MPs elected in the 2010 United Kingdom general election

| elected_members = List of MPs elected in the 2015 United Kingdom general election

| show_last_election = yes

| party1 = Labour Party (UK)

| leader1 = Ed Miliband

| last_election1 = 256

| current_seats1 = 12

| votes1 =

| percentage1 = 26.1

}}

==No current seats==

{{Testcase table

| election_name = British general election, 2015

| country = United Kingdom

| previous_election = 2010

| next_election = 2017

| election_date = 7 May 2015

| ongoing = yes

| outgoing_members = List of MPs elected in the 2010 United Kingdom general election

| elected_members = List of MPs elected in the 2015 United Kingdom general election

| no_current_seats = yes

| party1 = Labour Party (UK)

| leader1 = Ed Miliband

| last_election1 = 256

| current_seats1 = 12

| votes1 =

| percentage1 = 26.1

}}

==First election==

{{Testcase table

| election_name = British general election, 2015

| country = United Kingdom

| previous_election = 2010

| next_election = 2017

| election_date = 7 May 2015

| ongoing = yes

| outgoing_members = List of MPs elected in the 2010 United Kingdom general election

| elected_members = List of MPs elected in the 2015 United Kingdom general election

| first_election = yes

| party1 = Labour Party (UK)

| leader1 = Ed Miliband

| last_election1 = 256

| current_seats1 = 12

| votes1 =

| percentage1 = 26.1

}}

==Default==

{{Testcase table

| election_name = British general election, 2015

| country = United Kingdom

| previous_election = 2010

| next_election = 2017

| election_date = 7 May 2015

| ongoing = yes

| outgoing_members = List of MPs elected in the 2010 United Kingdom general election

| elected_members = List of MPs elected in the 2015 United Kingdom general election

| party1 = Labour Party (UK)

| leader1 = Ed Miliband

| last_election1 = 256

| current_seats1 = 12

| votes1 =

| percentage1 = 26.1

}}

=No=

{{Testcase table

| election_name = British general election, 2015

| country = United Kingdom

| previous_election = 2010

| next_election = 2017

| election_date = 7 May 2015

| ongoing = no

| party1 = Labour Party (UK)

| leader1 = Ed Miliband

| seats1 = 170

| last_election1 = 256

| current_seats1 = 12

| votes1 =

| percentage1 = 26.1

| party2 = Green Party of England and Wales

| leader2 = Natalie Bennett

| seats2 = 136

| last_election2 = 1

| current_seats2 = 12

| votes2 =

| percentage2 = 20.9

| party3 = Liberal Democrats (UK)

| leader3 = Nick Clegg

| seats3 = 126

| last_election3 = 56

| current_seats3 = 12

| votes3 =

| percentage3 = 19.4

| party4 = UK Independence Party

| leader4 = Nigel Farage

| seats4 = 94

| last_election4 = 2

| current_seats4 = 12

| votes4 =

| percentage4 = 14.4

| party5 = Conservative Party (UK)

| leader5 = David Cameron

| seats5 = 88

| last_election5 = 302

| current_seats5 = 12

| votes5 =

| percentage5 = 13.5

| party6 = Scottish National Party

| leader6 = Nicola Sturgeon

| seats6 = 14

| last_election6 = 6

| current_seats6 = 12

| votes6 =

| percentage6 = 2.2

| party7 = Democratic Unionist Party

| leader7 = Peter Robinson

| seats7 = 6

| last_election7 = 8

| current_seats7 = 12

| votes7 =

| percentage7 = 0.9

| party8 = Sinn Féin

| leader8 = Gerry Adams

| seats8 = 5

| last_election8 = 5

| current_seats8 = 12

| votes8 =

| percentage8 = 0.8

| party9 = Plaid Cymru

| leader9 = Leanne Wood

| seats9 = 4

| last_election9 = 3

| current_seats9 = 12

| votes9 =

| percentage9 = 0.6

| party10 = Ulster Unionist Party

| leader10 = Mike Nesbitt

| seats10 = 3

| last_election10 = 0

| current_seats10 = 12

| votes10 =

| percentage10 = 0.4

| party11 = Social Democratic and Labour Party

| leader11 = Alasdair McDonnell

| seats11 = 3

| last_election11 = 3

| current_seats11 = 12

| votes11 =

| percentage11 = 0.5

| party12 = Alliance Party of Northern Ireland

| leader12 = David Ford

| seats12 = 1

| last_election12 = 1

| current_seats12 = 12

| votes12 =

| percentage12 = 0.2

| map = 2010UKElectionMap.svg

| map_caption = Colours denote the winning party, as shown in the main table of results

| title = Prime Minister

| before_election = David Cameron

| before_party = Conservative Party

| after_election = Ed Miliband

| after_party = Labour Party

}}

Ongoing (first)

{{Testcase table

| election_name = British general election, 2015

| country = United Kingdom

| previous_election = 2010

| next_election = 2017

| election_date = 7 May 2015

| ongoing = yes

| first_election = yes

| party1 = Labour Party (UK)

| leader1 = Ed Miliband

| seats1 = 170

| seats1_before = 256

| votes1 =

| percentage1 = 26.1

| party2 = Green Party of England and Wales

| leader2 = Natalie Bennett

| seats2 = 136

| last_election2 = 1

| votes2 =

| percentage2 = 20.9

| party3 = Liberal Democrats (UK)

| leader3 = Nick Clegg

| seats3 = 126

| last_election3 = 56

| votes3 =

| percentage3 = 19.4

| party4 = UK Independence Party

| leader4 = Nigel Farage

| seats4 = 94

| last_election4 = 2

| votes4 =

| percentage4 = 14.4

| party5 = Conservative Party (UK)

| leader5 = David Cameron

| seats5 = 88

| last_election5 = 302

| votes5 =

| percentage5 = 13.5

| party6 = Scottish National Party

| leader6 = Nicola Sturgeon

| seats6 = 14

| last_election6 = 6

| votes6 =

| percentage6 = 2.2

| party7 = Democratic Unionist Party

| leader7 = Peter Robinson

| seats7 = 6

| last_election7 = 8

| votes7 =

| percentage7 = 0.9

| party8 = Sinn Féin

| leader8 = Gerry Adams

| seats8 = 5

| last_election8 = 5

| votes8 =

| percentage8 = 0.8

| party9 = Plaid Cymru

| leader9 = Leanne Wood

| seats9 = 4

| last_election9 = 3

| votes9 =

| percentage9 = 0.6

| party10 = Ulster Unionist Party

| leader10 = Mike Nesbitt

| seats10 = 3

| last_election10 = 0

| votes10 =

| percentage10 = 0.4

| party11 = Social Democratic and Labour Party

| leader11 = Alasdair McDonnell

| seats11 = 3

| last_election11 = 3

| votes11 =

| percentage11 = 0.5

| party12 = Alliance Party of Northern Ireland

| leader12 = David Ford

| seats12 = 1

| last_election12 = 1

| votes12 =

| percentage12 = 0.2

| map = 2010UKElectionMap.svg

| map_caption = Colours denote the winning party, as shown in the main table of results

| title = Prime Minister

| before_election = David Cameron

| before_party = Conservative Party

| after_election = Ed Miliband

| after_party = Labour Party

}}

Finished

{{Testcase table

| election_name = British general election, 2015

| country = United Kingdom

| previous_election = 2010

| next_election = 2017

| election_date = 7 May 2015

| ongoing = no

| party1 = Labour Party (UK)

| leader1 = Ed Miliband

| seats1 = 170

| last_election1 = 256

| votes1 =

| percentage1 = 26.1

| party2 = Green Party of England and Wales

| leader2 = Natalie Bennett

| seats2 = 136

| last_election2 = 1

| votes2 =

| percentage2 = 20.9

| party3 = Liberal Democrats (UK)

| leader3 = Nick Clegg

| seats3 = 126

| last_election3 = 56

| votes3 =

| percentage3 = 19.4

| party4 = UK Independence Party

| leader4 = Nigel Farage

| seats4 = 94

| last_election4 = 2

| votes4 =

| percentage4 = 14.4

| party5 = Conservative Party (UK)

| leader5 = David Cameron

| seats5 = 88

| last_election5 = 302

| votes5 =

| percentage5 = 13.5

| party6 = Scottish National Party

| leader6 = Nicola Sturgeon

| seats6 = 14

| last_election6 = 6

| votes6 =

| percentage6 = 2.2

| party7 = Democratic Unionist Party

| leader7 = Peter Robinson

| seats7 = 6

| last_election7 = 8

| votes7 =

| percentage7 = 0.9

| party8 = Sinn Féin

| leader8 = Gerry Adams

| seats8 = 5

| last_election8 = 5

| votes8 =

| percentage8 = 0.8

| party9 = Plaid Cymru

| leader9 = Leanne Wood

| seats9 = 4

| last_election9 = 3

| votes9 =

| percentage9 = 0.6

| party10 = Ulster Unionist Party

| leader10 = Mike Nesbitt

| seats10 = 3

| last_election10 = 0

| votes10 =

| percentage10 = 0.4

| party11 = Social Democratic and Labour Party

| leader11 = Alasdair McDonnell

| seats11 = 3

| last_election11 = 3

| votes11 =

| percentage11 = 0.5

| party12 = Alliance Party of Northern Ireland

| leader12 = David Ford

| seats12 = 1

| last_election12 = 1

| votes12 =

| percentage12 = 0.2

| map = 2010UKElectionMap.svg

| map_upright = 1.4

| map_caption = Colours denote the winning party, as shown in the main table of results

| title = Prime Minister

| before_image = x65px

| before_election = David Cameron

| before_party = Conservative Party

| after_image = x65px

| after_election = Ed Miliband

| after_party = Labour Party

}}

Finished (first)

{{Testcase table

| election_name = British general election, 2015

| country = United Kingdom

| previous_election = 2010

| next_election = 2017

| election_date = 7 May 2015

| ongoing = no

| first_election = yes

| turnout = ?

| party1 = Labour Party (UK)

| leader1 = Ed Miliband

| seats1 = 170

| last_election1 = 256

| votes1 =

| percentage1 = 26.1

| party2 = Green Party of England and Wales

| leader2 = Natalie Bennett

| seats2 = 136

| last_election2 = 1

| votes2 =

| percentage2 = 20.9

| party3 = Liberal Democrats (UK)

| leader3 = Nick Clegg

| seats3 = 126

| last_election3 = 56

| votes3 =

| percentage3 = 19.4

| party4 = UK Independence Party

| leader4 = Nigel Farage

| seats4 = 94

| last_election4 = 2

| votes4 =

| percentage4 = 14.4

| party5 = Conservative Party (UK)

| leader5 = David Cameron

| seats5 = 88

| last_election5 = 302

| votes5 =

| percentage5 = 13.5

| party6 = Scottish National Party

| leader6 = Nicola Sturgeon

| seats6 = 14

| last_election6 = 6

| votes6 =

| percentage6 = 2.2

| party7 = Democratic Unionist Party

| leader7 = Peter Robinson

| seats7 = 6

| last_election7 = 8

| votes7 =

| percentage7 = 0.9

| party8 = Sinn Féin

| leader8 = Gerry Adams

| seats8 = 5

| last_election8 = 5

| votes8 =

| percentage8 = 0.8

| party9 = Plaid Cymru

| leader9 = Leanne Wood

| seats9 = 4

| last_election9 = 3

| votes9 =

| percentage9 = 0.6

| party10 = Ulster Unionist Party

| leader10 = Mike Nesbitt

| seats10 = 3

| last_election10 = 0

| votes10 =

| percentage10 = 0.4

| party11 = Social Democratic and Labour Party

| leader11 = Alasdair McDonnell

| seats11 = 3

| last_election11 = 3

| votes11 =

| percentage11 = 0.5

| party12 = Alliance Party of Northern Ireland

| leader12 = David Ford

| seats12 = 1

| last_election12 = 1

| votes12 =

| percentage12 = 0.2

| map = 2010UKElectionMap.svg

| map_upright = 1.4

| map_caption = Colours denote the winning party, as shown in the main table of results

| title = Prime Minister

| before_image = x65px

| before_election = David Cameron

| before_party = Conservative Party

| after_image = x65px

| after_election = Ed Miliband

| after_party = Labour Party

}}

Custom party colour

{{Testcase table

| election_name = British general election, 2015

| country = United Kingdom

| previous_election = 2010

| next_election = 2017

| election_date = 7 May 2015

| ongoing = no

| first_election = yes

| party1 = Labour Party (UK)

| leader1 = Ed Miliband

| seats1 = 170

| last_election1 = 256

| votes1 =

| percentage1 = 26.1

| colour1 = pink

| party2 = Green Party of England and Wales

| leader2 = Natalie Bennett

| seats2 = 136

| last_election2 = 1

| votes2 =

| percentage2 = 20.9

| color2 = chartreuse

| title = Prime Minister

| before_image = x65px

| before_election = David Cameron

| before_party = Conservative Party

| after_image = x65px

| after_election = Ed Miliband

| after_party = Labour Party

}}

No leader or percentage

{{Testcase table

|election_name = 1901 Dalmatian parliamentary election

|country = Kingdom of Dalmatia

|previous_election = 1895

|next_election = 1908

|seats_for_election = All 41 seats in the Diet of Dalmatia

|election_date = 1901

|turnout =

|noleader = yes

|nopercentage = yes

| leader1 =

| party1 = People's Party

| last_election1 = 23

| seats1 = 18

| percentage1 =

| leader2 =

| party2 = Party of Rights

| last_election2 = 3

| seats2 = 9

| percentage2 =

| leader3 =

| party3 = Serb People's Party

| last_election3 = 9

| seats3 = 6

| percentage3 =

| leader4 =

| party4 = Autonomist Party

| last_election4 = 6

| seats4 = 6

| percentage4 =

| leader5 =

| party5 = Pure Party of Rights

| last_election5 = New

| seats5 = 2

| percentage5 =

}}

Embedding

{{Testcase table

| election_name = British general election, 2015

| country = United Kingdom

| previous_election = 2010

| next_election = 2017

| election_date = 7 May 2015

| ongoing = no

| first_election = yes

| color1 = inherit

| module = {{Infobox legislative election/sandbox

| embed = yes

| election_name = House of Commons

| party1 = Labour Party (UK)

| leader1 = Ed Miliband

| seats1 = 170

| last_election1 = 256

| votes1 =

| percentage1 = 26.1

| party2 = Green Party of England and Wales

| leader2 = Natalie Bennett

| seats2 = 136

| last_election2 = 1

| votes2 =

| percentage2 = 20.9

| module = {{Infobox legislative election/sandbox

| embed = yes

| election_name = House of Lords

| party1 = Labour Party (UK)

| leader1 = Ed Miliband

| seats1 = 170

| last_election1 = 256

| votes1 =

| percentage1 = 26.1

| colour1 = pink

| party2 = Green Party of England and Wales

| leader2 = Natalie Bennett

| seats2 = 136

| last_election2 = 1

| votes2 =

| percentage2 = 20.9

| color2 = chartreuse

| title = Prime Minister

| before_image = x65px

| before_election = David Cameron

| before_party = Conservative Party

| after_image = x65px

| after_election = Ed Miliband

| after_party = Labour Party

}}

}}

}}

=Embedded in infobox election=

{{test case nowiki|format=columns|showcode=no|{{Infobox election

| election_name = 2018 Mexican general election

| country = Mexico

| election_date = 1 July 2018

| module = {{Infobox election

| embed = yes

| election_name = Presidential election

| turnout = 63.43% ({{increase}} 0.35%)

| previous_election = 2012 Mexican general election

| previous_year = 2012

| next_election = 2024 Mexican general election

| next_year = 2024

| image1 = File:Reunión con el Presidente Electo, Andrés Manuel López Obrador 8 (cropped).jpg

| candidate1 = Andrés Manuel López Obrador

| party1 = Morena (political party)

| alliance1 = Juntos Haremos Historia

| home_state1 = Tabasco

| popular_vote1 = 30,113,483

| states_carried1 = 30+CDMX

| percentage1 = 53.19%

| image2 = File:Ricardo Anaya (cropped 2).jpg

| candidate2 = Ricardo Anaya

| party2 = National Action Party (Mexico)

| alliance2 = Por México al Frente

| home_state2 = Querétaro

| popular_vote2 = 12,610,120

| percentage2 = 22.28%

| states_carried2 = 1

| image4 = File:Mexican Foreign Minister José Antonio Meade (16295258100) (cropped).jpg

| candidate4 = José Antonio Meade

| party4 = Institutional Revolutionary Party

| alliance4 = Todos por México

| home_state4 = Mexico City

| popular_vote4 = 9,289,853

| percentage4 = 16.41%

| image5 = File:Reunión con el Gobernador Electo de Nuevo León, Jaime Rodríguez. (cropped).jpg

| candidate5 = Jaime Rodríguez Calderón

| party5 = Independent politician

| alliance5 = None

| home_state5 = Nuevo León

| color5 = 7D2181

| popular_vote5 = 2,961,732

| percentage5 = 5.23%

| map_image = File:Mexico general election 2018.svg

| map_size = 350px

| map_caption = States won by López Obrador in red, Anaya in blue.

| title = President

| before_election = Enrique Peña Nieto

| before_party = Institutional Revolutionary Party

| after_party = Morena (political party)

| after_election = Andrés Manuel López Obrador

| module = {{__TEMPLATENAME__

| embed = yes

| election_name = Senate

| previous_election = 2012

| next_election = 2024

| party1 = Morena (political party) | leader1 = Andrés Manuel López Obrador | percentage1 = 37.50 | seats1 = 55 | last_election1 = new

| party2 = National Action Party (Mexico) | leader2 = Ricardo Anaya | percentage2 = 17.59 | seats2 = 23 | last_election2 = 38

| party3 = Institutional Revolutionary Party | leader3 = José Antonio Meade | percentage3 = 15.90 | seats3 = 13 | last_election3 = 57

| party4 = Party of the Democratic Revolution | leader4 = Manuel Granados Covarrubias | percentage4 = 5.27 | seats4 = 8 | last_election4 = 23

| party5 = Citizens' Movement (Mexico) | leader5 = Dante Delgado Rannauro | percentage5 = 4.68 | seats5 = 7 | last_election5 = 1

| party6 = Ecologist Green Party of Mexico | leader6 = {{nowrap|Jorge Emilio González Martínez}} | percentage6 = 4.46 | seats6 = 7 | last_election6 = 4

| party7 = Labor Party (Mexico) | leader7 = Alberto Anaya | percentage7 = 3.82 | seats7 = 6 | last_election7 = 4

| party8 = Social Encounter Party | leader8 = Hugo Eric Flores Cervantes | percentage8 = 2.33 | seats8 = 8 | last_election8 = new

| party9 = New Alliance Party (Mexico) | leader9 = Luis Castro Obregón | percentage9 = 2.31 | seats9 = 1 | last_election9 = 1

| module = {{__TEMPLATENAME__

| embed = yes

| election_name = Chamber of Deputies

| previous_election = 2015

| next_election = 2021

| party1 = Morena (political party) | leader1 = Andrés Manuel López Obrador | percentage1 = 37.25 | seats1 = 189 | last_election1 = 35

| party2 = National Action Party (Mexico) | leader2 = Ricardo Anaya | percentage2 = 17.93 | seats2 = 83 | last_election2 = 108

| party3 = Institutional Revolutionary Party | leader3 = José Antonio Meade | percentage3 = 16.54 | seats3 = 45 | last_election3 = 203

| party4 = Party of the Democratic Revolution | leader4 = Manuel Granados Covarrubias | percentage4 = 5.27 | seats4 = 21 | last_election4 = 56

| party5 = Ecologist Green Party of Mexico | leader5 = {{nowrap|Jorge Emilio González Martínez}} | percentage5 = 4.79 | seats5 = 16 | last_election5 = 47

| party6 = Citizens' Movement (Mexico) | leader6 = Dante Delgado Rannauro | percentage6 = 4.41 | seats6 = 27 | last_election6 = 26

| party7 = Labor Party (Mexico) | leader7 = Alberto Anaya | percentage7 = 3.93 | seats7 = 61 | last_election7 = 6

| map = 2018 Mexican general election - Chamber of Deputies.svg

}}

}}

}}

}}}}

Linking issue

{{testcase table

| election_name = Made up election

| country = Lithuania

| date = 14 October 2013

| previous_election = 2012

| next_election = 2024

| party1 = Made up party name | leader1 = Andrés Manuel López Obrador | percentage1 = 37.50 | seats1 = 55 | last_election1 = new | color1 = red

| party2 = Made up party name 2 | leader2 = Ricardo Anaya | percentage2 = 17.59 | seats2 = 23 | last_election2 = 38 | color2 = #FF0000

| party3 = Institutional Revolutionary Party | leader3 = José Antonio Meade | percentage3 = 15.90 | seats3 = 13 | last_election3 = 57

| party4 = Party of the Democratic Revolution | leader4 = Manuel Granados Covarrubias | percentage4 = 5.27 | seats4 = 8 | last_election4 = 23

| party5 = Citizens' Movement (Mexico) | leader5 = Dante Delgado Rannauro | percentage5 = 4.68 | seats5 = 7 | last_election5 = 1

| title = Prime Minister

| before_election = Andrius Kubilius

| before_party = Made up Party Name

| after_election = Rolandas Paksas

| after_party = Party 1Party 2

}}